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