Find and fix the error in the if-else statement. import java. util. Scanner;
public class NumberChecker {
public static void main (String [] args) {
int userNum;
Scanner scnr = new Scanner (System. in);
userNum = scnr. nextInt (); / / Program will be tested with values: 0, 1, 2, 3.
if (userNum = 2) {
System. out. println ("Num is equal to two");
}
else {
System. out. println ("Num is not two");
}
}
}
+3
Answers (2)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Find and fix the error in the if-else statement. import java. util. Scanner; public class NumberChecker { public static void main (String ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Home » Computers & Technology » Find and fix the error in the if-else statement. import java. util. Scanner; public class NumberChecker { public static void main (String [] args) { int userNum; Scanner scnr = new Scanner (System. in); userNum = scnr.