(Move to ...)
▼
Program to find Factorial of number
#include <iostream.h>
void main()
{
int i , number , factorial ;
cout<<"Enter a number :\n";
cin>>number;
for (i=1,factorial=1 ; i<=number ; i++)
factorial = factorial * i ;
cout<<"The factorial of "<<number<<" : "<<factorial;
}
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment