Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



In the following program, how many times ‘for’ loop will be executed?
#include <stdio.h>
void main()
{
    int i = 5;
    for (;;)
        printf("%d", i);
}





Solution

The loop condition is for(;;) which has no condition and no termination statement. Hence the loop never stops.


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...