Create a program that will read the values of A and B. Compare the two values of A & B then print which of the values is higher including the remark "Higher".
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int A;
int B;
System.out.print("Enter A: ");
A=in.nextInt();
System.out.print("Enter B: ");
B=in.nextInt();
if (A>B)
System.out.println("A is higher");
else
System.out.println("B is higher");
}
}
Comments
Leave a comment