How to use the C Programming MCQ Quiz
- 1. Pick the lengthChoose 10 C Programming questions or all 21, with shuffle on or off.
- 2. Answer each questionTap an option to see at once if it is right, plus a short C Programming explanation.
- 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.