Home » C Programming » Loops » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 0;
    for (; ; ;)
    printf("Hey...\n");
    printf("Hello...\n");
    }
    1. Hey...
    2. Hello...
    3. Runtime Error
    4. Compilation Error
    5. None of these
Correct Option: D

Compilation Error

In function 'int main()':
5:18: error: expected primary-expression before ';' token
for (; ; ;)
^

5:18: error: expected ')' before ';' token
5:19: error: expected primary-expression before ')' token
for (; ; ;)



Your comments will be displayed only after manual approval.