```
:) mario.c compiles
:) rejects a height of -1
:) handles a height of 0 correctly
:( handles a height of 1 correctly
\ expected output, but not " ##\n ##\n ##\n ##\n ##\..."
:( handles a height of 2 correctly
\ expected output, but not " ###\n ###\n ###\n ###\n ..."
:( handles a height of 23 correctly
\ expected output, but not " ########################\n ##..."
:( rejects a height of 24, and then accepts a height of 2
\ expected output, but not " ###\n ###\n ###\n ###\n ..."
:) rejects a non-numeric height of "foo"
:) rejects a non-numeric height of ""```
// declare Height
int height;
do {
printf ("Height:");
height = get_int();
//Handle 0
if(height == 0) {
return 0;
}
}
while ( height > 23 || height < 1 );
for (int rows = 0; rows < 5; rows++)
{
for (int spaces = 0 + (rows - 1); spaces < 5 ; spaces++)
{
printf("%s", " ");
}
for (int hashs = 0; hashs < height + 1 ; hashs++) // loop for hashs
{
printf("#");
}
printf("\n");
}
}
```

You should probably post this at cs50â€™s reddit, people there are more likely to help you.

Also, the errors show you what the problem is, your for loops are wrong. Take a look at them and understand what they do.

you are almost there

why did you write 5 here:

`for (int rows = 0; rows < **5**; rows++)`

Iâ€™m assuming youâ€™re doing the â€śless comfortableâ€ť version of the problem, based on your code.

First off, youâ€™re looping from 0 to 5 for the rows, do you think you need to loop from 0 to something else instead? Second, `printf("%s", " ");`

can simply be written as `printf(" ");`

, no need for the string formatting.

Finally, just remember that for each row, you need to print `height - (rows + 1)`

spaces, and `rows + 1`

hash symbols.

For example, assuming the userâ€™s input is 4 for height, then the pyramid would look like this (had to use periods for the spaces since spaces didnâ€™t show for some reason):

`...#`

â€“ 4 - (0 + 1) spaces, 0 + 1 hash symbols

`..##`

â€“ 4 - (1 + 1) spaces, 1 + 1 hash symbols

`.###`

â€“ 4 - (2 + 1) spaces, 2 + 1 hash symbols

`####`

â€“ 4 - (3 + 1) spaces, 3 + 1 hash symbols

I hope this hint helps you solve the problem. Let me know if you manage to get it working properly or if you need more help.

I got it!!! thanks so much!