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

1 Expert Approved Answer
Step: 1 Unlock

EqualityAndRelationaljava Java program to input an integer and di... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!