#include <iostream> using namespace std; int main(){ int i,fact=1,num; num = 5; //Change the number here for(i=1;i<=num;i++) fact=fact*i; cout<< "Factorial of "<< num <<" is: " << fact; return 0; }
Factorial of 5 is: 120
Comments :