Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Scanner bill = new Scanner(System.in);
  2. System.out.println("Adjon meg egy számot 1000 és 9999 között");
  3. int szam = bill.nextInt();
  4. if (szam >= 1000 && szam <=9999)
  5. {
  6. if(szam % 2 == 0 )
  7. {
  8. System.out.print("A szám osztható 2-vel" + System.lineSeparator());
  9. }
  10. if(szam % 3 == 0 )
  11. {
  12. System.out.print("A szám oszható 3-mal" +System.lineSeparator());
  13. }
  14. if (szam % 4 == 0 )
  15. {
  16. System.out.print("A szám osztható 4-el" + System.lineSeparator());
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement