GATE CS 2017 (Afternoon) — Question 14

Programming in CPointers, Multi-Dimensional Arrays, StructuresMCQ1 mark · −1/3 if wrongMedium

Consider the following function implemented in C:
c
1void printxy (int x, int y)
2{
3    int *ptr;
4    x = 0;
5    ptr = &x;
6    y = *ptr;
7    *ptr = 1;
8    printf ("%d, %d", x, y);
9}
10
The output of invoking printxy (1, 1) is
  1. A
    0, 0
  2. B
    0, 1
  3. C
    1, 0
  4. D
    1, 1
Practise the full 2017-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAThis week's 10-question challengeSame 10 past-GATE questions for everyone this week — see where you stand.
Practise more on Pointers, Multi-Dimensional Arrays, StructuresTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group