C++ Program to Find Factorial
//C++ Program to Find Factorial
//header files
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
unsigned long n, factorial = 1;
cout << "Enter a positive integer to find its factorial: ";
cin >> n;
for(int i = 1; i <=n; i++)
{
factorial *= i;
}
cout << "Factorial of " << n << " = " << factorial;
getch();
}
Output
