C++ Program to calculate the factorial of an integer with output
techee INDIA |
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
system("cls");
int i, num ,fact=1;
cout<<"\nEnter integer : ";
cin>>num;
i=num;
while(num)
{
fact*=num;
--num;
}
cout<<"\nThe factorial of "<<i<<" is : "<<fact<<"\n";
return 0;
}
output: -
techee INDIA |
Jai hind
C++ Program to calculate the factorial of an integer with output
Reviewed by mushrafkhan772
on
July 13, 2018
Rating:
Interesting program.
ReplyDeletethank you
DeleteNice 👍 great programming
ReplyDeleteThanks buddy
Delete