Advertisement
MeehoweCK

Untitled

Oct 21st, 2023
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     std::cout << "Prosze wpisac liczbe n: ";
  5.     int n, wynik{ 1 }, i{ 2 };
  6.     std::cin >> n;
  7.  
  8.     while (i <= n) {
  9.         wynik *= i;
  10.         ++i;
  11.     }
  12.  
  13.     std::cout << "Silnia " << n << " wynosi " << wynik << std::endl;
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement