Wednesday, July 29, 2020

Write a Program find Factorial Number in C++.

Factorial Number in C++.


#include<iostream>
using namespace std;
int main()
{
int i, no, fact=1;
cout<<"Enter the any no. : ";
cin>>no;
for(i=1;i<=no;i++)
{
fact=fact*i;
}
cout<<"Factorial: "<<fact;
return 0;
}
OUTPUT

Enter the any no. : 5
Factorial: 120

No comments:

Post a Comment

Please do not any spam link in Comment Box