CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickCards Java

Dry run with a trace table

Dry run with a trace table

ICSE · DRY RUN

Dry run with a trace table

Stepisum
start10
pass 121
pass 233
pass 346

One column per variable, one row per step

Output questions become easy once you dry run them the right way.

Guessing the output from memory leads to mistakes. A dry-run table keeps every change visible, especially for loops, increments and nested conditions.

Notice whether the code uses print() or println(), because that decides whether output appears on the same line.

Practise this method on every output question for two weeks and you will see the difference.

The table traces: int sum = 0; for (int i = 1; i <= 3; i++) sum += i; The loop stops when i becomes 4, so sum is 6.

More Java cards

Stuck on this in your own syllabus? Ask Kajal Ma'am in a free demo class.
Book a free demo class

Written by Kajal Mehta (Kajal Ma'am), MCA, teaching computer subjects since 2004. All KwickCards · KwickAcademy

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →