Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner bill = new Scanner(System.in);
- System.out.println("Adjon meg egy számot 1000 és 9999 között");
- int szam = bill.nextInt();
- if (szam >= 1000 && szam <=9999)
- {
- if(szam % 2 == 0 )
- {
- System.out.print("A szám osztható 2-vel" + System.lineSeparator());
- }
- if(szam % 3 == 0 )
- {
- System.out.print("A szám oszható 3-mal" +System.lineSeparator());
- }
- if (szam % 4 == 0 )
- {
- System.out.print("A szám osztható 4-el" + System.lineSeparator());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement