menu search
person
Write a C++ program to find the factorial of a natural number inputted during program execution.
[March 2008, ] Maharashtra board turbo C++ code
thumb_up_alt 0 like thumb_down_alt 0 dislike
252 views

1 Answer

 
verified
image
#include<iostream.h>
#include<conio.h>

void main()
{
 int i,n;
 long int fact;

  clrscr();

 cout<<"Enter the number to find the Factorial"<<endl;
 cin>>n;

 fact=1;
 for (i=1;i<=n;i++)
 {
fact=fact*i;
 }
  cout<<"The Factorial of the given number is "<<fact<<endl;

 getch();
 }
For Turbo c++
thumb_up_alt 0 like thumb_down_alt 0 dislike
...