My pyramid keeps coming out upside and incomplete. I am not sure what I did wrong but I think it is in my code for the #s. I replaced my spaces with S's to make sure they are there. Can someone help me figure out where i went wrong?
int GetHeight(void);
int main(void)
{
int n = GetHeight();
int space,hash;
for(int i = 0; i < n; i++)
{
for(space = n-(i-1); space > 0; space--)
{
printf("s");
}
for(hash = 4; hash < n + 1; hash++)
{
printf("#");
}
printf("\n");
}
}
int GetHeight(void)
{
int n;
do
{
printf("Height: \n");
n = GetInt();
}
while(n < 0 || n > 23);
return n;
}