In Java, write a program that reads two integer values from the user and compares them. If the first number is greater than the second, print "TRUE", else print "FALSE". You should first scan an integer 'a' and then scan an integer 'b'.
Comparing values. Relational operators
Comparing two integers inputted by user
Report a typo
Sample Input 1:
5
3Sample Output 1:
TRUESample Input 2:
2
4Sample Output 2:
FALSEWrite a program in Java 17
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Create a Scanner to read input from the user.
Scanner sc = new Scanner(System.in);
// Read two integer values from the user.
int a = sc.nextInt();
int b = sc.nextInt();
// Compare the two values and print the result.
// ADD YOUR CODE HERE
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.