Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  odd.cpp
Language: C/C++
Code:
#include<iostream.h>
class A
{
public:
int odd(int n)
{
if(n%2!=0)
{
return(n*odd(n-2));
}
}
};
void  main()
{
int n;
A ob;
cout<<"enter the number";
cin>>n;
if((n!=0)&&(n%2==0)&&(n!=1))
{
n=n-1;
cout<<"odd no is",ob.odd(n);
}
else
{
ob.odd(n);
}
}
          
          
          
          
Comments: