Computer Applications
Identify all the errors in the following repetitive statements.
while (z < 1 && z > 100)
{
a = b;
}
Java Iterative Stmts
8 Likes
Answer
The test expression z < 1 && z > 100 will never be true as the conditions z < 1 and z > 100 cannot be true at the same time. Thus, the && operator will always result in false.
Answered By
6 Likes
Related Questions
How are these statements different from each other:
(i) break
(ii) continue
(iii) System.exit(0)
Identify all the errors in the following repetitive statements.
for (int i = 5; i > 0; i++) { System.out.println("Java"); }Identify all the errors in the following repetitive statements.
while (x == y) { xx = yy; x = y; }What is an empty statement? Explain its usefulness.