Practise programming with C and C++ questions, output puzzles, data-structure exercises and worked solutions. Choose a topic below, make your own attempt, and then compare the explanation. You can read the material without an account.

Start with C or C++ fundamentals

Build your data-structures foundation

If an explanation assumes a concept you have not learned, pause and work through the relevant tutorial:

Try an output-prediction exercise

Open a set, hide the answer, and trace each statement on paper. Write down variable values and the exact output, including spaces. Then compare the explanation:

Move on to programming problems

A practical routine for each question

  • Restate the problem and identify the inputs, outputs and constraints.
  • Make an attempt before reading the solution. For a short program, trace it line by line.
  • Run your own code locally with compiler warnings enabled. Read the C or C++ compilation notes if needed.
  • Test an empty or smallest allowed input, repeated values and boundary cases where they apply.
  • Compare the explanation, correct your attempt, and note the rule or algorithm you missed.

For a longer walkthrough, read a four-step process for solving coding problems. This page collects reading and practice material; it does not run or score submissions. New material appears as it is published, without a fixed daily question schedule.