Factorial of a number in C++ - 👑 सार्थक मुंड S3 🤴🏻

Factorial of a number in C++

Factorial of a number in C++

Write a program (WAP) in C++ to calculate Factorial of a numbers.

#include <iostream>
using namespace std;
int main()
{
    int i,fact=1,num;
    cout<<"Enter a Number:\n ";
    cin>>num;
    for(i=1;i<=num;i++)
    {
        fact=fact*i;
    }
    cout<<"Factorial of " <<num<<" is: "<<fact;
    return 0;
}

Out Put  :-

Factorial of a number in C++
Must Read :-
  1. Blogger Tutorial
  2. C Programs
  3. C++ Programs
  4. Java Programs
  5. Python Programs
  6. Programming Notes 
  7. Questions & Answers
  8. My Codes : HTML, CSS & JS
  9. All Subject Notes
Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads