Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. //Úloha 15
  2. public static void main(String[] args) {
  3.  
  4. Scanner scan = new Scanner(System.in);
  5.  
  6. char q = '"';
  7. System.out.println("Program ktorý ti určí či je číslo párne alebo nepárne");
  8.  
  9. Scanner sc = new Scanner(System.in);
  10.  
  11. int x = sc.nextInt();
  12. sc.close();
  13. int y = x % 2;
  14.  
  15. boolean z = ( y == 0 );
  16. if (z) {
  17. System.out.println("Toto číslo je párne");
  18. } else {
  19. System.out.println("Toto číslo je nepárne");
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement