I am sorry if I miss something obvious here, but I am an absolute beginner. I get the following output from check50
, which I am confused about:
I will attach my code below, but my output for 2 is:
To me those two outputs seem alright? I attach my code below sorry if it's not great:
int pyramid_height;
// Prompt user for pyramid height and check if value is
// between 0 and 23
do
{
pyramid_height = get_int("Pyramid height: ");
}
while (pyramid_height < 0 || pyramid_height > 23);
// Printing pyramid and adding space and #
for (int x = 0; x < pyramid_height; x++)
{
int y;
// Left Pyramid
for (y = 0; y < (pyramid_height - x) - 1; y++)
{
printf(" ");
}
for (int r = 0; r < (pyramid_height) - y; r++)
{
printf("#");
}
// Space Between Pyramids
for (int q = 0; q < 2; q++)
{
printf(" ");
}
// Right Pyramid
for (int r = 0; r < (pyramid_height) - y; r++)
{
printf("#");
}
for (int w = 0; w < (pyramid_height - w) - 1; w++)
{
printf(" ");
}
printf("\n");
}