التالي
0 / 7
الوحدة النمطية DEMO-32-58DEMO-C-32

Count to Twenty

DEMO-C-32 • Programming in C

Browser-only practice

بيان المشكلة

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

Your program should use a loop to generate and display the sequence of integers starting from 1 and ending at 20. Each number should be printed on its own line.

This is a simple exercise to practice basic loop constructs in C programming.

قيود

No input is required Use a loop structure (for, while, or do-while) Print exactly one number per line Numbers must be in ascending order from 1 to 20

تنسيق الإدخال

This program takes no input. It should run and produce output directly.

تنسيق الإخراج

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

Example: 1 2 3 ... 20

حالات اختبار نموذجية

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

العينة رقم 1
عينة ظاهرة
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Sample test case showing the expected output format with numbers 1 through 20, each on a new line.

Web terminal

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

Saved in this browser
إعدادات المحرر