Pointers Questions and Answers

Practice Mode
Showing 10 of 217 questions
Q41
Given the declaration double prec [5]; the address of the element prec [2] is obtained by:
  • A &prec [2]
  • B prec +2
  • C both options a and b
  • D *(prec +2)
Answer: Option C
Q42
Given the declaration int prec[5]; the element prec[2] is accessed by
  • A prec [2]
  • B prec +2
  • C *(prec + 2)
  • D both options a and c
Answer: Option D
Q43
Given float x [5][5]; the address of the element x [2] [3] is obtained by
  • A &x[2][3]
  • B x[2] +3
  • C *(prec +2)
  • D all the above
Answer: Option D
Q44
Given char s[4][10]; the element s[2][4] is accessed by
  • A s[2][4]
  • B *(s[2] + 4)
  • C *( *(s + 2) + 4)
  • D all the above
Answer: Option D
Q45
Given int a[5][5]; identify the correct expression, yielding the starrting element.
  • A *a[0]
  • B **a
  • C a[0][0]
  • D all the above
Answer: Option D
Q46
Given int x[5] [10] [8]; find the address of the element x[2][3][5].
  • A x[2][3] + 5
  • B *(x[2] + 3) + 5
  • C * ( *(x + 2)+ 3 +5
  • D all the above
Answer: Option D
Q47
Given int x [5][5][5]; find the value of the element x[2][3][4]
  • A *( x[2][3] + 4)
  • B *( *(x[2] + 3) + 4)
  • C *(*(*(x+2) + 3) + 4)
  • D all the above
Answer: Option D
Q48
Given int a [5]; how to declare arrau in the function definition if the function call is sort (a).
  • A sort (int *a
  • B sort (int a[5])
  • C both options a and b
  • D sort (int a)
Answer: Option C
Q49
The declaration float *a[5]; is
  • A an ordinary array
  • B a pointer to an array
  • C an array of pointers
  • D pointer to an array
Answer: Option C
Q50
The declaration int (*p) [8]; is
  • A an array of pointers
  • B a pointer to an array
  • C pointer to function
  • D function returning pointer
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test