Lucian_Adrian

#49 Factorial

Sep 21st, 2021
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int n;
  6.  
  7. cin >> n;
  8.  
  9.  
  10. long long int p = 1;
  11.  
  12.  
  13. for (int i = 1 ; i <= n ; i++)
  14. p *= i;
  15.  
  16.  
  17. cout << p << endl;
  18.  
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment