Consider the following program in C language: #include <stdio.h> main() { int…

GATE · 2014 · CS · Set 1 · Computer Science & IT

Consider the following program in C language:

#include <stdio.h>
main()
{
    int i;
    int *pi = &i;
    scanf("%d",pi);
    printf("%d\n", i+5);
}

Which one of the following statements is TRUE?

  1. A.

    Compilation fails.

  2. B.

    Execution results in a run-time error.

  3. C.

    On execution, the value printed is 5 more than the address of variable i.

  4. D.

    On execution, the value printed is 5 more than the integer value entered.

Attempted by 505 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…