Thought Sharing

Friday, February 25, 2011

FACTORIALS OF A NUMBER IN C++

Write a program to find Factorials of a number

#include
#include
void main()
{
clrscr();
int n, fact=1;
cout<<"Enter the number: ";
cin>>n;
for ( int i=1; i<=n; i++)
{
fact= fact * i;
cout<}
cout<<"Factorial of this number is: ";
cout<getch();
}