C++ Program to find factorial of a number

ad+1


Program:


// Program By http://solutionscpp.blogspot.com
// Author Mansoor Ahmed
// GMail ID: secguy000@gmail.com

#include<iostream>
using namespace std;

int main()
{
    int n=0;
    int f=1;
   
    cout<<"Enter Number: ";
    cin>>n;
   
    for(int i=1; i<=n; i++)
    {
        f=f*i;
    }
   
    cout<<"Factorial of Number is " <<f;
   
    return 0;
 
 }


Output:

 

 

1 comment: Leave Your Comments