Advertisement
LukaszPanko

Zadanie 11

Mar 29th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int liczba;
  6.  
  7. int c,i,b;
  8. void SILNIA(int l)
  9. {
  10.         c=l;
  11.          b=1;
  12.         for(i = l ; i != 1 ;i--)
  13.         {
  14.  
  15.             b=b*c;
  16.             c=c-1;
  17.  
  18.         }
  19.  
  20.         cout<<"Silnia wynosi:"<<b;
  21.     }
  22. int main()
  23. {
  24.     cout << "Podaj liczba z ktorej chcesz obliczyc silnie: " ;
  25.     cin >> liczba;
  26.     SILNIA(liczba);
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement