Pointers in c language: 18 MCQs
All 18 multiple-choice questions from this kit, free and with no sign-up.
Warm-up · 7 questions
Q1. What is the primary purpose of a pointer in C?
BeginnerAnswers and explanations are in the Veda app.
Q2. Which operator is used to declare a pointer variable in C?
BeginnerAnswers and explanations are in the Veda app.
Q3. What does the '&' operator do when applied to a variable?
BeginnerAnswers and explanations are in the Veda app.
Q4. Given `int x = 10; int *p = &x;` What is the value of `*p`?
BeginnerAnswers and explanations are in the Veda app.
Q5. What is a null pointer in C?
BeginnerAnswers and explanations are in the Veda app.
Q6. A pointer variable stores the memory address of another variable.
BeginnerAnswers and explanations are in the Veda app.
Q7. The dereference operator (*) is used to get the address of a variable.
BeginnerAnswers and explanations are in the Veda app.
Building up · 9 questions
Q8. What is the output of the following code? ```c int a = 5; int *p = &a; *p = 8; printf("%d", a); ```
IntermediateAnswers and explanations are in the Veda app.
Q9. What happens when you dereference a null pointer?
IntermediateAnswers and explanations are in the Veda app.
Q10. What is pointer arithmetic?
IntermediateAnswers and explanations are in the Veda app.
Q11. If `int *p` points to an integer array, what does `p + 1` represent?
IntermediateAnswers and explanations are in the Veda app.
Q12. What is the relationship between arrays and pointers in C?
IntermediateAnswers and explanations are in the Veda app.
Q13. What is a pointer to a pointer?
IntermediateAnswers and explanations are in the Veda app.
Q14. What is the correct way to pass a pointer to a function to modify the original variable?
IntermediateAnswers and explanations are in the Veda app.
Q15. What is the main advantage of using pointers in C?
IntermediateAnswers and explanations are in the Veda app.
Q16. What is the correct way to free dynamically allocated memory in C?
IntermediateAnswers and explanations are in the Veda app.
Topper level · 2 questions
Q17. What is a function pointer in C?
AdvancedAnswers and explanations are in the Veda app.
Q18. What is a dangling pointer?
AdvancedAnswers and explanations are in the Veda app.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Paper Solver
Get Veda free See what students get
Free to start · Android app and web · More than 40 languages