What is the output of the following java question
Attachments:
Answers
Answered by
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
Math,
4 months ago
Math,
4 months ago
Social Sciences,
8 months ago
Physics,
11 months ago
Math,
11 months ago