Advertisements
Advertisements
प्रश्न
Which of the following for loop will not be an infinite loop?
विकल्प
for(; ;)
for (a = 0; a < 1; a--)
for (a = 0; ; a++)
for (a = −1; a < 1; a++)
MCQ
उत्तर
for (a = −1; a < 1; a++)
Explanation:
for(a = -1; a < 1; a++)
is not an infinite loop because a
starts at -1
and increments until a < 1
becomes false.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?