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?

Beginner
Show answer & explanation

—

Q2. How do you access elements of a 2D array in C? Provide the syntax.

Beginner
Show answer & explanation

—

Q3. What is the purpose of the `goto` statement in C? Give a simple example.

Beginner
Show answer & explanation

—

Q4. How do you declare a pointer in C? How do you initialize and dereference it?

Beginner
Show answer & explanation

—

Building up · 11 questions

Q5. What is a Variable Length Array (VLA) in C? Give an example.

Intermediate
Show answer & explanation

—

Q6. What is the NULL statement in C? When is it used?

Intermediate
Show answer & explanation

—

Q7. Explain the comma operator in C with an example.

Intermediate
Show answer & explanation

—

Q8. What is a NULL pointer? What happens if you dereference it?

Intermediate
Show answer & explanation

—

Q9. What is a void pointer? How is it used?

Intermediate
Show answer & explanation

—

Q10. What is a wild pointer? How can it be avoided?

Intermediate
Show answer & explanation

—

Q11. What is a dangling pointer? Give an example of how it occurs.

Intermediate
Show answer & explanation

—

Q12. What is a double pointer (pointer to pointer)? How is it declared?

Intermediate
Show answer & explanation

—

Q13. What is a pointer to a function? How is it different from a function pointer?

Intermediate
Show 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.

Intermediate
Show 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.

Intermediate
Show 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?

Advanced
Show answer & explanation

—

Q17. What are `setjmp` and `longjmp` functions used for in C?

Advanced
Show answer & explanation

—

Q18. What is a function pointer? How do you declare and use it?

Advanced
Show answer & explanation

—

Q19. What are multilevel pointers? Provide an example.

Advanced
Show 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.

Advanced
Show 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.

Advanced
Show 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.

Advanced
Show answer & explanation

—

1 mark for each of the four mechanisms (total 4 marks), 1 mark for use cases, 1 mark for examples.

Make your own

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