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. Income is greater than 3000
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...

Which Draw Borders option allows you to change the style of the line border?

A) Pen Type B) Line Style C) Line Type D) Pen Style

Computer Science & Information Technology

Who developed the Extensible Markup Language (XML)?

a) Microsoft b) Sun MicroSystems c) World Wide Web Consortium d) Oracle

Computer Science & Information Technology