D. Triangle
Problem Setup
- login to CS50 IDE
- write
cdin the terminal to go to the home directory - write
mkdir triangleto create a folder calledtriangle - write
cd triangleto go to thetrianglefolder - write
code triangle.cppto create a file calledtriangle.cppand open it in the editor
Problem
You are given an integer \(n\). Make a triangle of size \(n\).
Input
The first line contains an integer \(n\) where \(1 \leq n \leq 100\).
Output
Print a triangle of size \(n\).
Examples
Example 1:
Input:
3
Output:
*
**
***
Example 2:
Input:
5
Output:
*
**
***
****
*****
Test Your Code
Make sure you are in the triangle directory, then run the following command:
check50 iti-technical-team/problemset/2026/2/triangle
Submit Your Code
Make sure you are in the triangle directory, then run the following command:
submit50 iti-technical-team/problemset/2026/2/triangle