C++ Program to find Factorial of any Number

 #include<iostream>

using namespace std;

int main()

{

int i,n,f=1;

cout<<"Enter a number whose factorial you want!";

cin>>n;

i=1;

while(i<=n)

{

f=f*i;

i++;

}

cout<<"Factorial of "<<n<<" is "<<f<<endl;

}

Comments

Popular posts from this blog