Write a C++ program to find factorial of a given number.

Write a C++ program to find factorial of a given number.


Write a C++ program to find factorial of a given number.

Answer :
File Name : C.cpp

#include<iostream>
using namespace std;

int a,i,fact=1;
int main(){
cout<<"Enter Number : ";
cin>>a;
for(i=a; i>=1; i--)
fact = fact * i ;
cout<<"Factorial of Given Number is : "<<fact<<endl;
return 0;
}
Write a C++ program to find factorial of a given number. Write a C++ program to find factorial of a given number. Reviewed by technical_saurabh on May 02, 2021 Rating: 5

No comments:

Powered by Blogger.