Q:

C basic increasing/decreasing issue in for loop

just undertaking one online course, trying to make an assignment for something like reverse triangle. I am able to this in python, but for some reason in C it is not working for me, specifically the part of the for loop, where should be decreasing the k value. Tried it also in other blank project, just to verify the issue, but so far it was not working for me. Increasing (j loop) is working, decreasing (k loop) for some reason is not (also with all syntax options: k = k - 1; k -= 1; k--). 
Don't know where can be the issue. 
int main(void){
   int height, i, j, k;
   bool check = false;

while (check == false)
{
    height = get_int("Height: ");

    if (height >= 1 && height <= 8)
    {
        for (i = 0; i < height; i++)
        {
            for (k = height -2; k >=0; k--)
            {
                printf(".");
            }
            for (j = 0; j <= i; j++)
            {
                printf("#");
            }
            printf("\n");
        }
        check = true;
    }
}}

For height 5, this is the target output
....#
...##
..###
.####
#####

and this is the actual output
....#
....##
....###
....#####
....###### 

A:

In the second loop k needs to be >= i and not >= 0. I replaced the get_int with 5.
int main(void){
int height, i, j, k;
bool check = false;

while (check == false)
{
    height = 5;

    if (height >= 1 && height <= 8)
    {
        for (i = 0; i < height; i++)
        {
          for (k = height -2; k >= i; k--)
          {
            printf(".");
          }
          for (j = 0; j <= i; j++)
          {
            printf("#");
          }
          printf("\n");
    }
    check = true;
}
}}

Output:
....#                                                                                                                                                                                        
...##                                                                                                                                                                                        
..###                                                                                                                                                                                        
.####                                                                                                                                                                                        
#####

