Subex Papers: Sample Questions 1 - 2 of 19

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 1

» Aptitude

Short Answer Question▾

Write in Short

What does (*a) [10] means?

Explanation

  • A pointer is a variable which contains the address in memory of another variable. We can have a pointer to any variable type. The unary or monadic operator (&) gives the “address of a variable”. The indirection or dereference operator (*) gives the “contents of an object pointed to by a pointer”.
  • An array is a collection of similar elements (i. e. same data type). We can use a pointer to an array and then we can use that pointer to access the array. We can declare array like, z [5] i. e. z is an array of 5 elements, z [0], z [1], z [2], z [3], z [4]
  • Here, a is a pointer to an array of 10 integers.

Question number: 2

» Aptitude

MCQ▾

Question

What is the below?

int * ptr [10];

Choices

Choice (4) Response

a.

Declaration and defn of an array of 10 pointers

b.

Declaration of 10 pointers

c.

Declaration and defn of 10 pointers

d.

None of the above

Answer

d.

Explanation

Here, ptr is a pointer to an array of 10 integers.

An array is a collection of similar elements. An array is similar to an ordinary variable except that it can store multiple elements of similar data type. Array elements are stored in contiguous memory locations and so they can be accessed using pointers. To know the address of any element of array we need to use “address of” operator (&). To know the value of any element of array we need to use “value at address” operator (*).