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

Binary Search, Linear Search, Selection Sort and Bubble sort Python Menu Program

Housie/Tambola using Python with Tickets in PDF file

100% Working C++ Tambola/Housie Code with 90 Unique Numbers