fork download
  1. #include <iostream>
  2. using namespace std;
  3. int factorial(int num) {
  4. for (int i=1; i<= num;i++) {
  5. num = num*i;
  6. }
  7. return num;
  8.  
  9. }
  10. int main() {
  11. // your code goes here
  12. cout<<"" <<factorial(4);
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
-861720576