1
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Assume the following C variable declaration

int * A[10], B[10][10];

Of the following expressions

I. A[2]
II. A[2] [3]
III. B[1]
IV. B[2] [3]

Which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
A
I, II, and IV only
B
II, III, and IV only
C
II and IV only
D
IV only
2
GATE CSE 2000
MCQ (Single Correct Answer)
+1
-0.3
The following C declarations
struct node{
  int i:
  float j;
};
struct node *s[10];
define s to be
A
An array, each element of which is a pointer to a structure of type node
B
A structure of 2 fields, each field being a pointer to an array of 10 elements
C
A structure of 3 fields: an integer, a float, and an array of 10 elements
D
An array, each element of which is a structure of type node
3
GATE CSE 2000
MCQ (Single Correct Answer)
+1
-0.3
The most appropriate matching for the following pairs

X: m=malloc(5); m= NULL;
Y: free(n); n->value = 5;
Z: char *p; *p='a';

1: using dangling
2: using uninitialized pointers
3. lost memory
is:
A
X – 1 Y – 3 Z – 2
B
X – 2 Y – 1 Z – 3
C
X – 3 Y – 2 Z – 1
D
X – 3 Y – 1 Z – 2
4
GATE CSE 2000
MCQ (Single Correct Answer)
+1
-0.3
Consider the following C declaration
struct {
      short s[5];
      union {
      float y;
      long z;
      } u;
}t;
Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment considerations, is
A
22 bytes
B
14 bytes
C
18 bytes
D
10 bytes
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
CBSE
Class 12