been stuck on this for a couple days, i think i've gotten the spaces concept down, but what am i doing wrong with the #? i know the first row needs 2 #s, so would my for loop begin with hashes=2 ? Appreciate the feedback.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int height,spaces,rows,hashes;
do
{
printf("give me an integer:");
height = get_int();
}
while (height<=0|| height>=23);
for (rows=1;rows<=height;rows++)
{
for (spaces = height-rows;spaces>=0;spaces--)
{
printf("P");
}
for (hashes = 0;hashes<=height;hashes++)
{
printf("#");
}
{
printf("\n");
}
}
}