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

}
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, dreyes439
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
image
Computers and Technology, 22.06.2019 19:20, manny2085
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, bbgirl8638
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
image
Computers and Technology, 24.06.2019 16:00, nothingworksoutforme
Your is an example of personal information that you should keep private.
Answers: 1
Do you know the correct answer?
Find and fix the error in the if-else statement. import java. util. Scanner;

public clas...

Questions in other subjects:

Konu
Mathematics, 17.04.2021 01:00
Konu
Mathematics, 17.04.2021 01:00