Find Factorial of Any number using simple C++ coding
========================================================================
#include<iostream>
using namespace std;
int main()
{
int c, n, fact = 1;
cout<<"Enter your Number to calculate factorial\n";
cin>>n;
for (c = 1; c <= n; c++)
fact = fact * c;
cout<<"Factorial of "<<n<<"="<<fact;
return 0;
}
========================================================================
0 comments:
Post a Comment