• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Quiz - 104 | Question 1

With respect to following “for” loops in C, pick the best statement Assume that there is a prior declaration of \'i\' in all cases
C
for (i < 10; i = 0 ; i++) // (i)<br>
for (i < 10; i++ ; i = 0) // (ii)<br>
for (i = 0; i < 10 ; i++) // (iii)<br>
for (i = 0; i++ ; i < 10) // (iv)<br>
for (i++; i = 0 ; i < 10) // (v)<br>
for (i++; i < 0 ; i = 10) // (vi)<br>

(A)

All the above “for” loops would compile successfully.

(B)

All the above “for” loops would compile successfully. Except (iii), the behaviour of all the other “for” loops depend on compiler implementation.

(C)

Only (iii) would compile successfully.

(D)

Only (iii) and (iv) would compile successfully.

(E)

Only (iii) and (iv) would compile successfully but behaviour of (iv) would depend on compiler implementation.

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments