Sunday, March 17, 2013

Factorial Of A Number

#include<iostream>
using namespace std;
int main()
{
    int x,i,product;
    cout<<"Enter a number:";
    cin>>x;
    product=1;
    for(i=1;i<=x;++i)
    {
        product*=i;
    }
    cout<<product;
    return 0;
}

0 comments:

Post a Comment