Computer Science, asked by cavin7310, 11 months ago

Write a program in c++ to find the factorial of a number

Answers

Answered by RvChaudharY50
68

Answer:

#include <iostream>

using namespace std;

int main()

{

int i,fact=1,number;

cout<<"Enter any Number: ";

cin>>number;

for(i=1;i<=number;i++){

fact=fact*i;

}

cout<<"Factorial of " <<number<<" is: "<<fact<<endl;

return 0;

}

Answered by sweety759
5

C++ Program

#include<iostream>

using namespace std;

int main() {

int num,factorial=1;

cout<<" Enter Number To Find Its Factorial: ";

cin>>num;

for (int a=1;a<=num;a++) {

factorial=factorial*a;

Similar questions