TCS
Company
Programming
Variables
Comment on the below while statement=while (0 == 0) { }
A) It has syntax error as there are no statements within braces {}
B) It will run forever
C) It compares 0 with 0 and since they are equal it will exit the loop immediately
D) It has syntax error as the same number is being compared with itself
Read Solution (Total 3)
-
- It will run forever
- 6 years agoHelpfull: Yes(14) No(0)
- it will run forever.
as the condition becomes true.0==0.
since there is no break statement so cannot stop program which will run infinitely. - 6 years agoHelpfull: Yes(1) No(0)
- Option C is correct
- 6 years agoHelpfull: Yes(0) No(4)
TCS Other Question