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