CS50 pset-1 itsa Mario - make a half-pyramid using parameters from user input
Organized coding

A line of a pyramid is made by x spaces and y hashes. The number of spaces is given by the total line length minus the number of hashes. The number of hashes increases from 2 to 5, the max line length is 5

static int LINE_LEN = 5;
for (int hashes = 2; hashes &lt;= LINE_LEN; hashes++) {
    print_repeated_char(' ', LINE_LEN - hashes);
    print_repeated_char('#', hashes);
    printf("\n");
 }


Also note the print_repeated_char function avoids repetition.