0 votes
8 views
Write a C++ program to find the factorial of a natural number inputted during program execution.
[March 2008, ] Maharashtra board turbo C++ code
in Programming by (5.4k points) | 8 views

1 Answer

0 votes
Best answer
#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++
by (5.4k points)
500 questions
477 answers
8 comments
12 users