C++ Program to calculate the factorial of an integer with output

C++ Program to calculate the factorial of an integer with output




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: -


Program to calculate the factorial of an integer with output
techee INDIA



Jai hind

C++ Program to calculate the factorial of an integer with output C++ Program to calculate the factorial of an integer with output Reviewed by mushrafkhan772 on July 13, 2018 Rating: 5

4 comments:

Powered by Blogger.