i know this may have been asked quite some times but i have gone through many of the answers here and on other websites and i just can't understand them. the pyramid is printing OK but it is inverted, i tried exchanging the " " with the "#" didn't work, tried exchanging the statements also didnt work. please help, thanks! int main(void) { int height = 0; int spaces =0; int hashes= 0; int rows =0; do { printf("How many spaces?"); height = GetInt(); } while (height <0 || height >23);
for(rows = 0; rows< height; rows++) { for(hashes=rows;hashes<=height;hashes++){ printf("#"); } for(spaces=height-1;spaces>=height;spaces--){ printf(" "); }
printf("\n");
} }