C. Numbers
Problem Setup
- login to CS50 IDE
- write
cdin the terminal to go to the home directory - write
mkdir numbersto create a folder callednumbers - write
cd numbersto go to thenumbersfolder - write
code numbers.cppto create a file callednumbers.cppand open it in the editor
Problem
Given an integer \(n\), you need to print all numbers from 1 to \(n\) inclusive.
Input
The first line contains an integer \(n\) where \(1 \leq n \leq 100\).
Output
Print all numbers from 1 to \(n\) inclusive, space-separated.
Examples
Example 1:
Input:
3
Output:
1 2 3
Example 2:
Input:
5
Output:
1 2 3 4 5
Test Your Code
Make sure you are in the numbers directory, then run the following command:
check50 iti-technical-team/problemset/2026/2/numbers
Submit Your Code
Make sure you are in the numbers directory, then run the following command:
submit50 iti-technical-team/problemset/2026/2/numbers