Advertisement
DawidBartoszek3bTI

zad 11

Mar 31st, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int SILNIA (int x)
  6. {
  7. int i;
  8.  
  9. int s=1;
  10.  
  11. for (i=1; i<=x; i++) {
  12.     s=s*i;}
  13.  
  14.     return s;
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20.    cout<<"Silnia z 4 wynosi "<<SILNIA (4)<<endl;
  21.  
  22.    cout<<"Silnia z 3 wynosi "<<SILNIA (3)<<endl;
  23.  
  24.    cout<<"Silnia z 7 wynosi "<<SILNIA (7)<<endl;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement