Aspire's Library

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

Previous Year Question (PYQs)



What is output for the program given below?
#include <stdio.h>
void main()
{
    int i = 7;
    for (; i < 12; i++);
    printf("%d", i);
}






Solution

The semicolon after for makes it an empty loop. Loop ends when i = 12, which gets printed.


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