This is my code 😀, it was easy.

#include <iostream>

using namespace std;

int factorial(int x){
int f;
f=1,x;
for(int i=1;i<=x; i++){
f = f * i;
}
return f;
}

int main() {
int x;
cout << “Escribe un número: ” << endl;
cin >> x;
cout << “El número: ” << x << ” es: ” << factorial(x) << endl;
// your code goes here
return 0;
}

CC BY 4.0 Wsq09 by ferny580 is licensed under a Creative Commons Attribution 4.0 International License.