Skip to content

Instantly share code, notes, and snippets.

@dmlebron
Created June 10, 2019 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmlebron/80cd6cbd0fa0c3fbf1fb0df22d1ba098 to your computer and use it in GitHub Desktop.
Save dmlebron/80cd6cbd0fa0c3fbf1fb0df22d1ba098 to your computer and use it in GitHub Desktop.
int main(void)
{
int h = get_positive_int("Height: "); // ask height and store it as i
printf("Stored: %i\n", h); //confirm value
for (int k = 1; k <= h; k++)
{
for (int i = 1; i <= (h-k); i++)
{
printf(".");
}
for (int j = 1; j <= k; j++)
{
printf("#");
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment