Home » C Programming » Variables » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    int main()
    {
    printf("%d", num++);
    }
    int num = 15;
    1. 15
    2. Garbage value
    3. Runtime Error
    4. Compilation Error
    5. None of these
Correct Option: D

Compilation Error

main.c: In function ‘main’:
main.c:4:22: error: ‘d’ undeclared (first use in this function)
printf("%d", d++);
^
main.c:4:22: note: each undeclared identifier is reported only once for each function it appears in



Your comments will be displayed only after manual approval.