#include <cs50.h>
#include <stdio.h>
int main(void)
{
int n;
do
{
n = get_int ("Height: ");
}
while (n < 1 || n > 8);
for (int i = 0; i < n; i++)
{
for (int j = (i - 1); j < 6; j++)
{
printf(".");
}
printf("#\n");
}
}
And then it renders as this:
.......#
......#
.....#
....#
...#
..#
.#
#