Polnochniy

Untitled

Feb 5th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void Factorial(int N)
  4. {
  5. int rez = 1;
  6. for (int i = 1; i <= N; i++)
  7. {
  8. rez = rez * i;
  9. }
  10. cout << endl;
  11. cout << "Факториал равен" << " " << rez << endl;
  12. }
  13. int main()
  14. {
  15. setlocale(LC_ALL, "Russian");
  16. int N;
  17. cout << "Найдите факторил" << endl;
  18. cout << endl;
  19. cout << "Введите число " << endl;
  20. cin >> N;
  21. Factorial(N);
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment