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
131. Find the output void main ( ) { int i=4, j=-3; mul (&i, j); printf ("%d %d", i, j); } mu1 (int *a, int b) { *a=*a **a; b=b*b; }
- 4 3
- 4 9
- 16 -3
- None of these
132. Find the out #include "studio.h" void main ( ) { printf ("%d %d"), sizeof (NULL), sizeof (" ")); }
- 0 0
- 1 1
- 2 1
- 1 2
133. Where can pointers be used I. Dynamic memory allocation' II. Call by reference III. Implementing trees IV. Accessing string elements
- only I & II
- only III &IV
- I, II &IV
- All of these
134. What is the size of pointer if memory model is compact in Turbo C?
- 1 byte
- 2 byte
- 4 byte
- None of these
135. Find the output void main ( ) { int a=5, *p=&a; a=XXX (&p); printf ("%d %d", a, *p); } XXX (int **p) { int b= **p***p; }
- 25 25
- 5 65524
- Garbage value
- Compilation eror
136. The poitner which is created in data segment and holds the address within data segment is known as:
- Near pointer
- Bad pointer
- Smart pointer
- None of these
137. What is the difference between ++*p and *p++?
- In both cases pointers are incremented.
- In both cases values are incremented.
- In first case value is incremented and in second case pointer is incremented.
- In first case pointers is incremented and in second case value is incremented.
138. EP_SEG( ), FP_OFF ( ) are declared in which header file ?
- sys.h
- dos.h
- stdio.h
- offset.h
139. What is the formula to find real address ?
- segment address *16+offset address
- Segment address+offset address *16
- Segment address*10+offset address
- Segment address+ofset address*10
140. What happens when far address is incremented ?
- Only segment address is incremented.
- Only offset address is incremented.
- Both segment and offset address are incremented.
- None of these