Create Factorial.cpp

This commit is contained in:
biratkundu 2020-10-17 10:03:26 +05:30 committed by GitHub
parent c8c9f805f6
commit 236d94df49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
samples/Factorial.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <iostream>
using namespace std;
int main()
{
int i,fact=1,number;
cout<<"Enter any Number: ";
cin>>number;
for(i=1;i<=number;i++){
fact=fact*i;
}
cout<<"Factorial of " <<number<<" is: "<<fact<<endl;
return 0;
}