using c++
3. Write a function that outputs all the odd numbers between two given values, not including the numbers themselves. Don’t assume that the second number is greater than the first.
ANSWER:-
#include <iostream>
using namespace std;
void OddNumber(int n,int m)
{
if(n>m)
{
for(int i=m+1;i<n;i++)
{
if(i%2!=0)
cout<<i<<" ";
}
}
else
{
for(int i=n+1;i<m;i++)
{
if(i%2!=0)
cout<<i<<" ";
}
}
}
int main() {
int n,m;
cout<<"Enter two positive numbers : ";
cin>>n>>m;
OddNumber(n,m);
return 0;
}
// OUTPUT

// If any doubt please comment
using c++ 3. Write a function that outputs all the odd numbers between two given values,...