Home » C Programming » Variables » Question
  1. Comment on the output of the following C code.
    #include <stdio.h>
    int main()
    {
    int k;
    for (k = 0; k < 10; k++)
    int m = k;
    printf("%d", m);
    }
    1. Redeclaration of m in same scope throws error
    2. Syntax error in declaration of m
    3. m is out of scope when printf is called
    4. No errors, program will show the output 15
    5. None of these
Correct Option: B

Syntax error in declaration of m



Your comments will be displayed only after manual approval.