C++ Program to Find Factorial of Number

Code:

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int i, no, fact=1;
cout<<"Enter the any no. : ";
cin>>no;
for(i=1;i<=no;i++)
{
fact=fact*i;
}
cout<<"Factorial: "<<fact;
getch();
}

--------------------------------------------------------------------------------------------------------------------
Share To:

Adeel Rasheed

Post A Comment:

0 comments so far,add yours