Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cs50.h>
- #include <stdio.h>
- int main(void)
- {
- int height;
- int hash;
- int row;
- int space;
- do
- {
- height = get_int("Height between 1-8: ");
- }
- while (height < 1 || height > 8);
- {
- if (height > 0 && height < 9) {
- printf("Stored: %i\n", height);
- }
- }
- for (row = 1; row <= height; row++)
- {
- for (space = 0; space < height - row; space++)
- {
- printf(" ");
- }
- for (hash = 1; hash <= row; hash++)
- {
- printf("#");
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement