C++ Program to find Factorial of a input number

      No Comments on C++ Program to find Factorial of a input number
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x,i;
double y=1;
cout<<"Enter number to find Factorial:-"<<endl;
cin>>x;
for(i=x;i>=1;i--)
 {
 y=y*i;
 }
cout<<"Factorial of given number is:- "<<y;
getch();
}

OUTPUT:-

scanfcode

Leave a Reply

Your email address will not be published. Required fields are marked *