C Arrays & Pointers: 22 MCQs with answers
All 22 multiple-choice questions from this kit, free and with no sign-up.
Warm-up · 4 questions
Q1. What is a 1D array in C? How is it declared and initialized?
BeginnerShow answer & explanation
—
Q2. How do you access elements of a 2D array in C? Provide the syntax.
BeginnerShow answer & explanation
—
Q3. What is the purpose of the `goto` statement in C? Give a simple example.
BeginnerShow answer & explanation
—
Q4. How do you declare a pointer in C? How do you initialize and dereference it?
BeginnerShow answer & explanation
—
Building up · 11 questions
Q5. What is a Variable Length Array (VLA) in C? Give an example.
IntermediateShow answer & explanation
—
Q6. What is the NULL statement in C? When is it used?
IntermediateShow answer & explanation
—
Q7. Explain the comma operator in C with an example.
IntermediateShow answer & explanation
—
Q8. What is a NULL pointer? What happens if you dereference it?
IntermediateShow answer & explanation
—
Q9. What is a void pointer? How is it used?
IntermediateShow answer & explanation
—
Q10. What is a wild pointer? How can it be avoided?
IntermediateShow answer & explanation
—
Q11. What is a dangling pointer? Give an example of how it occurs.
IntermediateShow answer & explanation
—
Q12. What is a double pointer (pointer to pointer)? How is it declared?
IntermediateShow answer & explanation
—
Q13. What is a pointer to a function? How is it different from a function pointer?
IntermediateShow answer & explanation
—
Q14. Explain the concept of 1D and multi-dimensional arrays in C. How are they stored in memory? Write a C program to add two 2x2 matrices using 2D arrays.
IntermediateShow answer & explanation
—
1 mark for explaining 1D array storage, 1 mark for explaining 2D array storage (row-major), 1 mark for correct program logic, 1 mark for correct loops and indexing, 1 mark for correct output, 1 mark for proper syntax and use of headers.
Q15. Discuss the different special types of pointers in C: NULL pointer, void pointer, wild pointer, and dangling pointer. Explain with examples how each is created and how to avoid issues.
IntermediateShow answer & explanation
—
1 mark for each correct definition of the four pointer types (total 4 marks), 1 mark for examples, 1 mark for prevention methods.
Topper level · 7 questions
Q16. What is a Flexible Array Member in a structure? How is it declared?
AdvancedShow answer & explanation
—
Q17. What are `setjmp` and `longjmp` functions used for in C?
AdvancedShow answer & explanation
—
Q18. What is a function pointer? How do you declare and use it?
AdvancedShow answer & explanation
—
Q19. What are multilevel pointers? Provide an example.
AdvancedShow answer & explanation
—
Q20. Explain the concept of double pointers and multilevel pointers in C. Write a program that uses a double pointer to modify the value of an integer variable.
AdvancedShow answer & explanation
—
1 mark for explaining double pointer, 1 mark for explaining multilevel pointers, 1 mark for correct program logic, 1 mark for correct dereferencing, 1 mark for correct output, 1 mark for proper declaration and initialization.
Q21. What are function pointers and pointers to functions? How are they declared, initialized, and used? Provide a program that uses a function pointer to call different arithmetic operations.
AdvancedShow answer & explanation
—
1 mark for explaining function pointers, 1 mark for correct declaration syntax, 1 mark for initialization, 1 mark for calling via pointer, 1 mark for program correctness, 1 mark for demonstrating multiple functions.
Q22. Describe the advanced control flow mechanisms in C: `goto`, NULL statement, comma operator, and `setjmp`/`longjmp`. Explain their use cases and provide a small example for each.
AdvancedShow answer & explanation
—
1 mark for each of the four mechanisms (total 4 marks), 1 mark for use cases, 1 mark for examples.
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, in 42 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Exam prep
Get Veda free See what students get
Free to start · No ads · Works in 42 languages