Advertisement
B3ar6

Functions

Dec 7th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. void tytul()
  5. {
  6.     cout << endl;
  7.     cout << "PROGRAM OBLICZAJACY POLE POWIERZCHNIE PROSTOKATA" << endl << endl;
  8. }
  9.  
  10. float wczytaj(char bok)
  11. {
  12.     float x;
  13.     cout << "PODAJ DLUGOSC BOKU " << bok << " PROSTOKATA : ";
  14.     cin >> x;
  15.     return x;
  16. }
  17.  
  18. void pole()
  19. {
  20.     float a=wczytaj('A'),b=wczytaj('B');
  21.     cout << "POLE POWIERZCHNI PROSTOKATA " << a << " I " << b << " JEST ROWNE : " << a*b;
  22. }
  23.  
  24. int main()
  25. {  
  26.     tytul();
  27.     pole();
  28.    
  29.    
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement