Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7.     unsigned int n;
  8.     long double fatorial = 1;
  9.     cout << "Entre com o número: ";
  10.     cin >> n;
  11.     for(int i = 1; i <=n; ++i)
  12.     {
  13.         fatorial *= i;
  14.     }
  15.  
  16.     string s = to_string(fatorial);
  17.     cout << "Fatorial de " << n << " = " << s;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement