What will be the output of ‘a’ in following code? #include <stdio.h> int a =…

PYQ IBPS SO CRP SPL-VII (2017)Modified — slightly modified from the official paper; see the solution

What will be the output of ‘a’ in following code?

#include <stdio.h>
int a = 20;
int main()
{
int a=10;
printf("%d", a);
printf("%d", a);
return 0;
}
  1. A.

    20 20

  2. B.

    10 20

  3. C.

    20 10

  4. D.

    10 10

  5. E.

    Compilation error

Attempted by 36 students.

Sign up free to check your answer

Sign up free

Explore the full course: Ibps So It Mains

Loading lesson…