subject

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");
}

}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 17:50
You work in the accounting department and have been using a network drive to post excel workbook files to your file server as you complete them. when you attempt to save a workbook file to the drive, you see the error message: “you do not have access to the folder ‘j: \’. see your administrator for access to this folder.” what should you do first
Answers: 2
question
Computers and Technology, 24.06.2019 20:00
Write c++programs for the following problem: let the user enter two numbers and display which is greater. !
Answers: 1
You know the right answer?
Find and fix the error in the if-else statement. import java. util. Scanner;

public clas...
Questions
question
Geography, 15.10.2020 18:01
Questions on the website: 13722363