#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · INSTANT FEEDBACK

C Programming MCQ Quiz: Pointers, Arrays and the Basics That Trip People Up

Answer C programming questions from sizeof to pointers and malloc, with instant explanations.

  • 🔧 21 questions
  • 📍 Pointers and memory
  • ✅ Outputs checked with gcc

How to use the C Programming MCQ Quiz

  1. 1. Pick the lengthChoose 10 C Programming questions or all 21, with shuffle on or off.
  2. 2. Answer each questionTap an option to see at once if it is right, plus a short C Programming explanation.
  3. 3. See your scoreFinish to get your C Programming score and a review of all your answers.

What this quiz covers

C is still the first language in many B.Tech and BCA courses, and its questions appear in placement tests. This set covers:

  • Types and operators: sizeof, integer division, format specifiers and post-increment.
  • Arrays and strings: indexing from 0, the null terminator and strcmp.
  • Pointers: & and *, pointer arithmetic and pointers to pointers.
  • Memory: malloc, free and the heap.
  • Control flow: do-while, switch fall-through and recursion base cases.
  • Program structure: header files, the preprocessor, static variables, pass by value and valid names.

Worked example and how to use it

Example: int i = 5; printf("%d", i++); What is printed? The answer is 5. Post-increment gives the current value to printf first and then adds 1, so i is 6 only afterwards. With ++i the output would be 6.

Another important idea: if int *p points into an array, p++ moves to the next int, not the next byte. On a system where an int is 4 bytes, the address increases by 4.

Output answers were checked with gcc. Questions that depend on undefined behaviour, such as i++ + ++i, are left out on purpose: their output can differ between compilers, so they are not fair test questions. Practise writing small programs in the pattern programs generator, which also gives C code.

Frequently asked questions

Is sizeof(int) always 4?

No. The C standard only promises at least 16 bits. It is 4 bytes on most modern compilers, which is why the question says so.

Does it cover file handling?

Not in this set. It focuses on the core language topics most tests ask about.

Who is it for?

First-year students, BCA students and anyone preparing for placement tests that include C.

Is it free?

Yes, it is free to take. The final score asks for your name and WhatsApp number once, and then all Uncodemy tools open without the form.

More free tools

See all free tools