Lab exercise programs in C plus plus
Please visit http://csprograms.in/ for more Computer Science programs.
Welcome..!!
Please visit
http://csprograms.in/
for more Computer Science programs.
Showing posts with label
factorial number
.
Show all posts
Showing posts with label
factorial number
.
Show all posts
Tuesday, 13 March 2012
4. C++ program to find factorial of a given number.
#include <iostream>
int main()
{
int i,f,n;
f=1;
cout <<"Enter the number \n";
cin >>n;
for(i=1;i<=n;i++)
f=f*i;
cout <<"Factorial of "<<n <<" is "<<f;
return 0;
}
Older Posts
Home
Subscribe to:
Posts (Atom)