MichalWalczak

Zad 4

Mar 25th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int l;
  5. int liczba;
  6. bool a=true;
  7. bool b=false;
  8. int CZY_PARZYSTA(int l){
  9. if(l%2==0){
  10.     return a;
  11. }
  12. else{
  13.     return b;
  14. }
  15.  
  16. }
  17.  
  18. int main()
  19. {
  20.     cout << "Podaj liczbe"<<endl;
  21.     cin >> liczba;
  22.     cout <<CZY_PARZYSTA(liczba);
  23.     return 0;
  24. }
  25.  
  26. //Nie wiedziałem jak zrobić żeby funkcja boola zwracała true zamiast 1 dla prawdy i false dla fałszu zamiast 0. :(
Advertisement
Add Comment
Please, Sign In to add comment