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>
int main()
{
    int i = 59, j = 10;
    for( ; j ; i )
        printf("%d", i);
}





Solution

Loop condition is j, which is non-zero and never changes. Hence the loop runs infinitely.


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...