Unit 2 Task 4: Counting even raffle tickets

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 2 Task 4 - Counting even raffle tickets

← Unit 2 tasks · Solution


At a raffle, each ticket has a whole number. You type ticket numbers as they are sold. When you are done, you enter -1 (not a real ticket).

Write a program that:

Skills: while, if, %, counters.