Tuesday, June 26, 2012

PRODUCTS OF ODD NUMBERS IN C++

# include<iostream.h>
# include<conio.h>
void main()
{
      int count,product=1,num;
      cout<<"Enter the odd number";
      cin>>num;
      for(count=1;count<=num;count+=2)
     {
         product=count*product;
         cout<<"The odd number is"<<count;
      }
         cout<<"The product of odd number is:"<<product;
      getch();
}

No comments:

Post a Comment