NEW
New Website Launch
Experience the best way to solve previous year questions with mock tests (very detailed analysis), bookmark your favourite questions, practice etc...
1

GATE CSE 2003

MCQ (Single Correct Answer)
Consider the C program shown below.
#include < stdio.h >
#define print(x) printf("%d ", x)
int x;
void Q(int z) {
   z += x; print(z);
}
void P(int *y) {
   int x = *y+2;
   Q(x); *y = x-1;
   print(x);
}
main(void) {
   x = 5;
   P(&x);
   print(x);
}
The output of this program is
A
12 7 6
B
22 12 11
C
14 6 6
D
7 6 6
2

GATE CSE 2001

MCQ (Single Correct Answer)
Consider the following three C functions:
[P1] int*g(void)
     {
       int x=10;
       return(&x);
     }
[P2] int*g(void)
      {
        int *px;
       *px = 10;
        return px;
      }
[P3] int*g(void)
     {
       int *px
       px =(int*)malloc (size of (int));
       *px = 10;
       return px;
     }
Which of the above three functions are likely to cause problems with pointers?
A
Only P3
B
Only P1 and P3
C
Only P1 and P2
D
P1, P2 and P3
Write for Us

Do you want to write for us? Help us by contributing to our platform.

Questions Asked from Pointer and Structure in C

On those following papers in Marks 2
Number in Brackets after Paper Indicates No. of Questions
GATE CSE 2019 (1)
GATE CSE 2018 (1)
GATE CSE 2015 Set 1 (1)
GATE CSE 2012 (2)
GATE CSE 2008 (1)
GATE CSE 2006 (1)
GATE CSE 2004 (1)
GATE CSE 2003 (1)
GATE CSE 2001 (1)

Joint Entrance Examination

JEE Main JEE Advanced WB JEE

Graduate Aptitude Test in Engineering

GATE CSE GATE ECE GATE EE GATE ME GATE CE GATE PI GATE IN

Medical

NEET

CBSE

Class 12