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

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
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++

Related questions

0 votes
1 answer 362 views
0 votes
1 answer 1.5k views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...