Previous Next
0 / 18
Module DEMO-32-90DEMO-C-32

Countdown Printer

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a function void countdown(int start) that prints a countdown from the number `start` down to 0.

After 0, it should print "Blastoff!".

Each number and the final string should be on a new line.

Constraints

Start will be between 0 and 100.

Input Format

A single non-negative integer.

Output Format

Numbers from start to 0, followed by "Blastoff!".

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
3
3
2
1
0
Blastoff!
Counting down from 3.
Sample #2
Public sample
2
2
1
0
Blastoff!
Counting down from 2.
Sample #3
Public sample
0
0
Blastoff!
Counting down from 0.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings