Program to calculate factorial of given number
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
//Program to calculate factorial of given number
int a,n;
double res;
cout<<"Enter Number = ";
cin>>n;
res=1;
for(a=1;a<=n;a++)
res=res*a;
cout<<"The Factorial of Given number is ="<<res;
getch();
return 0;
}
#include <conio.h>
using namespace std;
int main()
{
//Program to calculate factorial of given number
int a,n;
double res;
cout<<"Enter Number = ";
cin>>n;
res=1;
for(a=1;a<=n;a++)
res=res*a;
cout<<"The Factorial of Given number is ="<<res;
getch();
return 0;
}
Comments
Post a Comment