Previous Next
0 / 15
Module DEMO-33-66DEMO-OOP-33

Countdown Timer

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Write a C program that prints a countdown from 20 to 1, with each number on a new line.

The program should use a loop to generate the countdown sequence. This simulates a simple countdown timer that might be used for a rocket launch or other time-sensitive event.

Example: If your program runs correctly, it should output:

20 19 18 ... 3 2 1

Constraints

Use only basic C syntax Must use a loop (for, while, or do-while) No arrays or advanced data structures Output must be exactly as specified

Input Format

This program takes no input. It should run and produce the countdown sequence automatically.

Output Format

Print the numbers from 20 down to 1, each on a separate line.

There should be exactly 20 lines of output, with the first line containing "20" and the last line containing "1".

Sample Testcases

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

Sample #1
Public sample
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
Sample test case showing the complete countdown from 20 to 1

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