- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
Tricky C Questions
These C questions look simple but hide a trap, from chained comparisons and integer promotion to octal literals and const pointers. The quiz is for experienced programmers preparing for interviews who want to explain not only what happens but why.
Sample question
Question 1 of 10According to the C standard, what is the value of 10 > 5 > 1?
Show the answer
A. 0, because it means (10 > 5) > 1, which is 1 > 1 C has no chained comparisons: > groups left to right and gives 0 or 1, so 10 > 5 becomes 1 and 1 > 1 is 0. The trap is common enough that recent clang versions reject it by default; write 10 > 5 && 5 > 1 for the maths meaning.
What this quiz covers
- Chained comparisons and operator precedence with shifts
- Integer promotion with
~and float vs double comparisons - Unsigned loop counters and loops with an empty body
- Octal literals, joined string literals and the type of
'a' const int *vsint *const
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.