#include <iostream>
#include <cmath>
using namespace std;
/*
pseudocode:
1. user enters the value
2. the factorial-> 5! - 1 x 2 x 3 x 4 x 5
so, it is the addition of that number + multiplied after, until value entered reached.
*/
// Find factorial of a number entered by the user.
int main(){
int n = 6;
int fact = 1;
for(int i = 1; i <= n; i++){
fact *= i;
}
return 0;
}
No comments:
Post a Comment