WiktorJagielski

Zad 4

Mar 23rd, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int CZY_PARZYSTA(int a)
  6. {
  7. if (a%2==0)
  8. {
  9. return 1;
  10. }
  11. else
  12. {
  13. return 0;
  14. }}
  15.  
  16. int main()
  17. {
  18. int a;
  19. cout << "Podaj liczbe, ktorej chcesz sprawdzic parzystosc, 1=parzysta, 0=nieparzysta " << endl;
  20. cout << "liczba: ";
  21. cin >>a;
  22. cout << CZY_PARZYSTA(a) << endl;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment