#include<iostream
>
#include<conio.h
>
using namespace std;
int main()
{
int num, fact=1;
cout<<"Enter a number to find factorial : ";
cin>>num;
for(int i=1;i<=num;i++)
{
fact=fact*i;
}
cout<<"Factorial of "<<num<<" is "<<fact;
getch();
return 0;
}
No comments:
Post a Comment