Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 0;
    for (foo(); i == 1; i = 2)
        printf("In for loop\n");
        printf("After loop\n");
}
int foo()
{
    return 1;
}

A. After loop

B. In for loop after loop

C. Compile time error

D. Infinite loop

Answer: Option A


This Question Belongs to C Program >> Control Structures

Join The Discussion

Related Questions on Control Structures