Google News
logo
C-Language - Interview Questions
Please explain what do you understand by while(0) and while(1)?
while(0) means that the looping conditions will always be false, i.e., the code inside the while loop will not be executed. On the opposite, while(1) is an infinite loop. It runs continuously until coming across a break statement mentioned explicitly.
 
Note : Any non-zero integer inside the braces of the while loop will give an infinite loop. For example, while(-22) and while(24) will both yield an infinite loop.
Advertisement