I need some help with my homework, i have to make a program that gives you the factorial of a number let me explain it, the shit ask you for a number, ok a fucking variable lets say you put 5 and then it multiplies 1x2x3x4 if you put 8 then 1x2x3x4x5x6x7 and so..
Im trying to make it right now but if some one can help me that will be cool
EDIT: maybe is easier just fix it, im having this error:
Im trying to make it right now but if some one can help me that will be cool
EDIT: maybe is easier just fix it, im having this error:
Code:
#include <iostream>
using namespace std;
int main () {
int number;
cout << "Put a fuckin number" << endl;
cin >> number;
for (int factorial=1 ; factorial <= number ; factorial++ ) {
factorial = factorial*factorial;
}
cout << "the factorial is: " <<endl;
cout << factorial << endl;
system("pause");
return 0;
}
Last edited: