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

Compilation Error

In function 'int main()':
5:24: error: expected ';' before ')' token
for (n < 3; n++)



Your comments will be displayed only after manual approval.