Factorial

Program to print the factorial of inserted Integer



#include<iostream.h>

#include<conio.h>

int main()

{

int num,factorial=1;

cout<<"Enter the number: ";
  
cin>>num;

for(int i=1;i<=num;i++)

factorial=factorial*i;

cout<<"The factorial of the given number is:"<<factorial<<endl;

getch();

return 0;

}

No comments :

Post a Comment