Hey guys so I've been struggling with how to go about getting my pyramid to print rightside up. So far I've only been able to get it to print with the base on the first row. Any help would be appreciated!
#include <cs50.h>
#include <stdio.h>
int main (void)
{
int height;
do
{
printf("Height:");
height = get_int();
}
while (height < 0 && height > 24);
for (int rows = 0; rows < height; rows++)
{
for (int spaces = height - (rows + 2); spaces >= 0; spaces--)
printf(" ");
for (int hashes = rows + 1; hashes <= height + 1; hashes++)
printf("#");
printf("\n");
}
}