a c++ program to find factorial of a number..
Answers
Answered by
3
please refer the attachment for the answer
please mark as brainliest
Attachments:
Answered by
2
Sample Program to find factorial:
#include<iostream>
using namespace std;
int main()
{
int n, fac = 1;
cout << " Enter an integer: ";
cin >> n;
for(int i = 1; i <= n; i++)
fac = fac * i;
cout << "Factorial of " << n <<" : " << fac;
return 0;
}
Output:
Enter an integer : 5
Factorial of 5 : 120
Hope it helps!
Similar questions