Write a program to calculate the factorial of any number

Calculate the Factorial Of Any Number

Write a program to calculate the factorial of any number

Object: Write a program to calculate the factorial of any number. C++ Projects.

Code:

#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int i,no,fact=1;
cout<<” Enter Any Number: “;
cin>>no;
for(i=no;i>=1;i–)
{
fact=fact*i;
}
cout<<“\n Factorial of given Number is: “<<fact;
getch();
}

 

Output:

Write a program to calculate the factorial of any number

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *