Can someone lend me some advice? I'm having trouble with finding the logic between the space and hashes.
int main(void)
{
int height, row, hash;
do
{
printf("Height: ");
height = get_int();
}
while (height < 0 || height > 23);
for (row = 0; row < height; row ++)
{
for(hash = 0; hash < height + 1; hash ++)
{
printf("#");
}
printf("\n");
}
}
row
(rather thanheight
). The number of spaces before the hashes might depend on bothrow
andheight
.