Program Calculate Factorial of a Number - Download Turbo C Language and C++ IDE and Programs Free


Perfect Collection of C Language and C++ Programs


Sunday, December 15, 2013

Program Calculate Factorial of a Number

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example,
    5! = 5 x 4 x 3 x 2 x 1 = 120
Note: The value of 0! is 1.

find factorial of a number C++ Program
Write a C++ Program to input a positive number
Calculate and Display Factorial of this number
by For Loop.

For Free C++ Programming Techniques (Example Programs), visit

and For Good Notes
Visit   Www.ForFreeEducation.Blogspot.Com


void main()


  int number, counter;
  long int factorial;

  cout<<"\n Enter the Number = ";


  factorial = 1;
  for (counter = 1; counter <= number; counter++)
           factorial = factorial * counter;

  cout<<"\n\n ----------- Results ------------";

  cout<<"\n\n The Factorial of the number "<<number<<"\n is "<<factorial;


Program Factorial