Sunday, 17 November 2013

Program to find factorial of Number in C++

#include<iostream>
int main()
{

    int num,factorial=1;

    cout<<" Enter Number To Find Its Factorial:  ";

    cin>>num;

    for(int a=1;a<=num;a++)

    {

        factorial=factorial*a;

    }

cout<<"Factorial of Given Number is ="<<factorial<<endl;

    return 0;
}

1 comment:

  1. The website is clear as to to find factorial of Number in C++. It clearly communicated the idea of why functions are beneficial in programming. If anyone want to learn C++ you can visit our website. This make a mastered in C++ programing. We have complete C++ tutorials teaching you to program in C++. Whether you’ve had any prior experience programming or not, the tutorials on this site will walk you through all the steps you’ll need to know in order to create and compile your programs..

    Thank you very much!

    ReplyDelete