I need your assistance with my code foe CS50 problem set 1, the mario(less comfortable).
I seem to have a few problems with the logic inside my code. Would you mind pointing out the mistakes? I would greatly appreciate if you could guide me through rather than showing me the answer.
Here is my code.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int height;
do
{
printf("Please type the height of pyramid: ");
height = GetInt();
}
while (height < 0 || height > 23);
for (int x = 1; x <= height; x++)
{
for (int space = 1; space <= height - x; space++)
{
printf(" ");
}
for (int hash = 1; hash < height + 1 ; hash++)
{
printf("#");
}
printf("\n");
}
}
Thank you so much in advance for your help.
Ichi