C++ Programs & Stuffz

Nothing like anything!!!

Please Click on ADS!!

Please Click on the above ads given by GOOGLE , so that I can maintain my blog!!

Tuesday, August 31, 2010

Find the factorial of a number

//pgm to find the factorial of a no
#include<iostream.h>
#include<conio.h>
void main()
{
    int i=1,f=1,n;
   cout<<"enter the number";
   cin>>n;
   while(i<=n)
   {
       f=f*i;
      i++;
   }
   cout<<"factorial of "<<n<<"is"<<f;
   getch();
}

0 comments:

Post a Comment

free counters