Basically this is my program, a person enters an integer which is the height of a half pyramid. It then generates the pyramid using spaces and hashes, it looks something like this
so far my program looks something like this:
Code:#include <cs50.h>#include <stdio.h> int main(void) { int height = GetInt(); int integer = 1; //int spaces = height - integer; int integer2 = 2; int numberOfHashes = height - (height - integer2); int loopcount = 0; while (loopcount < height) { while (integer < height) { printf(" "); integer++; } while (numberOfHashes > 0) { printf("#"); numberOfHashes--; } printf("\n"); loopcount++; } return 0; }
i dont get why it doesn't work. Someone please help. I would also like to add that i am totally new to programming and am still going over the basics, this is just a training program.
Thanks