Computer Science, asked by Swagster68, 8 months ago

What is the output of the following java question

Attachments:

Answers

Answered by Arianators
1

Answer:

Output: Compiler Error

There is an error in condition check expression of for loop. Java differs from C++(or C) here. C++ considers all non-zero values as true and 0 as false. Unlike C++, an integer value expression cannot be placed where a boolean is expected in Java. Following is the corrected program.

Similar questions