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");
}
}
}
+4
Answers (2)
Know the Answer?
Not Sure About the Answer?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Home » Computers and 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.