Guest User

Untitled

a guest
Jun 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned int n;
  7. unsigned long long factorial = 1;
  8.  
  9. cout << "Enter a positive integer: ";
  10. cin >> n;
  11.  
  12. for(int i = 1; i <=n; ++i)
  13. {
  14. factorial *= i;
  15. }
  16.  
  17. cout << "Factorial of " << n << " = " << factorial;
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment