Which of the following for loops will be an infinite loop?
A. for(; ;)
B. for(i=0 ; i<1; i--)
C. for(i=0; ; i++)
D. All of the above
Answer: Option D
Join The Discussion
Comments ( 1 )
Related Questions on Flow Control
What is the purpose of the "if" statement in Java?
A. To execute a block of code conditionally
B. To create loops
C. To declare variables
D. To define methods
A. No output
B. Error
C. Hello
D. 5
because the conditional statement by default is true so, there is break point will be encountered which can stop the loop in all the options.