This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter an integer:"); | |
int number = in.nextInt(); | |
boolean isEvenNumber = number % 2 == 0; | |
if(isEvenNumber) { | |
System.out.printf("The number %d is even!", number); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main1 { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.print("Enter a number: "); | |
int number = in.nextInt(); | |
while(number > 10_000) { | |
System.out.print("Number too large!. Try numbers below 10000: "); | |
number = in.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.print(1); | |
System.out.print(1.5f); | |
System.out.print(1.5); | |
System.out.print('a'); | |
System.out.print("Hello!"); | |
System.out.println(); | |
System.out.println(1); |