मराठी

Which of the following for loop will not be an infinite loop? - Computer Applications

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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.09: Iterative Constructs in Java - EXERCISES [पृष्ठ १२२]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 1.09 Iterative Constructs in Java
EXERCISES | Q I. 2. | पृष्ठ १२२
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×