Suppose income is 4001, what is the output of the following code?

if (income > 3000) {
System.out.println("Income is greater than 3000");
}
else if (income > 4000) {
System.out.println("Income is greater than 4000");
}

a. no output
b. Income is greater than 3000
c. Income is greater than 3000 followed by Income is greater than 4000
d. Income is greater than 4000
e. Income is greater than 4000 followed by Income is greater than 3000

b Since income is 4001, the condition (income > 3000) is true. So statement for the true case is executed.

Computer Science & Information Technology

You might also like to view...

A note inserted into the text of a report or research paper that refers to a source in the bibliography.

What will be an ideal response?

Computer Science & Information Technology

The Navigation Pane will show all of the following EXCEPT:

A) the formatting toolbar. B) table names. C) the term "All Access Objects." D) the symbol of a linked table.

Computer Science & Information Technology