Star Triangle

Lab C Beginner 10 points

Read n and print a right triangle of stars: row i has i stars.

Input

One integer.

Output

n rows.

Example

Input

4

Output

*
**
***
****
Sample input available Sample output available
Editor
C

Hints

The inner loop's limit depends on the outer loop variable.

Solution explanation

Nested loops: outer = rows, inner = characters in a row.

Show solution
#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < i; j++) {
            printf("*");
        }
        printf("\n");
    }
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD