Created
June 21, 2016 20:11
-
-
Save MuddyBootsCode/2faeb4dcb70a5d1f063fcc2f0e037d02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<cs50.h> | |
int main (void) | |
{ | |
int hgt = 0;// Initialize variable | |
int i, y; | |
do | |
{ | |
printf("Height:"); | |
hgt = GetInt(); | |
} while (hgt <= 0 || hgt > 23); | |
for (i = 0; i < hgt; i++) | |
{ | |
for (y = 0; y < hgt - i - 1; y++) | |
printf(" "); | |
for (y = 0; y < i + 2; y++) | |
printf("#"); | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment