GateAI
Programming in C

GATE CSE 2014 Set 1 · Q10

MCQ1 markEasy

Time

Consider the following program in C language:#include <stdio.h> main() { int i; int *pi = &i; scanf("%d",pi); printf("%d ", i+5); }Which one of the following statements is TRUE?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) On execution, the value printed is 5 more than the integer value entered.

Programming in C
  1. In the program, int *pi = &i; initializes the pointer pi with the memory address of variable i.

  2. In scanf("%d", pi);, pi is passed as the address where the user's input integer is to be stored, which correctly modifies the value of i.

  3. Then, `printf("%d

", i+5); prints the value of i + 5`.

  1. Therefore, upon successful execution, the value printed is 5 more than the integer value entered.

Thus, option D is TRUE.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Programming in C previous year question is Q10 of the GATE CSE 2014 Set 1 paper. Find more GATE CSE PYQs on Programming in C in Programming and Data Structures, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Programming in C PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Programming in C in GATE CSE

Programming in C has 74 GATE CSE PYQs across 25 papers from 2011 to 2026. 20 of them are 1-mark MCQs like this one, and GATE CSE 2014 Set 1 has 2.

How GATE tests Programming in C

More from GATE CSE 2014 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2014 Set 1 · Q10 · MCQ

Consider the following program in C language: #include main() { int i; int *pi = &i; scanf("%d",pi); printf("%d ", i+5); } Which one of the following statements is TRUE?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.