Pointers Questions and Answers
Pointers questions with answers are a crucial part of C programming preparation, often included in technical interviews and MCQ-based exams. Pointers are variables that store the memory address of other variables, making them fundamental to dynamic memory management and efficient program design. These C programming MCQ questions and answers help students understand pointer arithmetic, function pointers, arrays, and memory allocation. Commonly asked in placement exams by TCS, Infosys, and Wipro, mastering pointer concepts gives you a competitive edge in coding tests and programming interviews.
Pointers
Showing 10 of
217 questions
41. Given the declaration double prec [5]; the address of the element prec [2] is obtained by:
- &prec [2]
- prec +2
- both options a and b
- *(prec +2)
42. Given the declaration int prec[5]; the element prec[2] is accessed by
- prec [2]
- prec +2
- *(prec + 2)
- both options a and c
43. Given float x [5][5]; the address of the element x [2] [3] is obtained by
- &x[2][3]
- x[2] +3
- *(prec +2)
- all the above
44. Given char s[4][10]; the element s[2][4] is accessed by
- s[2][4]
- *(s[2] + 4)
- *( *(s + 2) + 4)
- all the above
45. Given int a[5][5]; identify the correct expression, yielding the starrting element.
- *a[0]
- **a
- a[0][0]
- all the above
46. Given int x[5] [10] [8]; find the address of the element x[2][3][5].
- x[2][3] + 5
- *(x[2] + 3) + 5
- * ( *(x + 2)+ 3 +5
- all the above
47. Given int x [5][5][5]; find the value of the element x[2][3][4]
- *( x[2][3] + 4)
- *( *(x[2] + 3) + 4)
- *(*(*(x+2) + 3) + 4)
- all the above
48. Given int a [5]; how to declare arrau in the function definition if the function call is sort (a).
- sort (int *a
- sort (int a[5])
- both options a and b
- sort (int a)
49. The declaration float *a[5]; is
- an ordinary array
- a pointer to an array
- an array of pointers
- pointer to an array
50. The declaration int (*p) [8]; is
- an array of pointers
- a pointer to an array
- pointer to function
- function returning pointer