Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
Factorial
I want to know source code of factorial in C++
2 Answers
+ 9
int num;
int result = 1;
cin >> num;
for (int i = 1; i <= num; i++)
{
result *= i;
}
cout << result;
I want to know source code of factorial in C++