Question: Write an expression that will cause greater or equal to -10 toprint if the value of userNum is greater than or equal to -10. import
Write an expression that will cause "greater or equal to -10" toprint if the value of userNum is greater than or equal to -10.
import java.util.Scanner;
public class EqualityAndRelational {
public static void main (String [] args) {
int userNum;
Scanner scnr = newScanner(System.in);
userNum = scnr.nextInt(); // Programwill be tested with values: -9, -10, -11, -12.
if (//solution goeshere//) {
System.out.println("greater or equal to -10");
}
else {
System.out.println("less than -10");
}
}
}
Step by Step Solution
3.38 Rating (148 Votes )
There are 3 Steps involved in it
EqualityAndRelationaljava Java program to input an integer and di... View full answer
Get step-by-step solutions from verified subject matter experts
