15,672,129 members
See more:
I am trying to make a breakpoint at line 33. WHen I run, the code runs through past line 33, however.

THanks,

What I have tried:

[^]
Posted
Updated 27-Dec-16 9:23am

## Solution 1

Probably because height is never equal to 1. But, it's impossible for us to know. We can't run your code and we don't have the data your code needs.

AGAIN!! The debugger would have told you what your code is doing. Setting the breakpoint on the if right above it and inspecting the values in the variables is the ONLY way you're going to solve this.

Member 12919791 27-Dec-16 15:26pm
Just if curious, my code:
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(void)
{
int height;
int i;
int spaces1;
int blocks1;
int spaces2;
int blocks2;

do
{
printf("Height: ");
height = GetInt();
if (height==0)
{
return 0;
}

}
while
(height < 0 || height > 23);

if (height == 1)
{
for (i=0; i<1;i++)
{
for (blocks1 = 0; blocks1 < 1; blocks1++)
{
printf("#");
}

printf(" ");

for (blocks2 = 0; blocks2 < 1; blocks2++)
{
printf("#");
}

printf("\n");
}
}

else
{
for (int a=1; a<height +1; a++)
{
for(spaces1 = 0; spaces1 < height-a; spaces1++)
{
printf(" ");
}

for (blocks1 = 0; blocks1 < a; blocks1++)
{
printf("#");
}

printf(" ");

for (blocks2 = 0; blocks2 < a; blocks2++)
{
printf("#");
}

for(spaces2 = 0; spaces2 < height - a; spaces2++)
{
printf(" ");
}

printf("\n");
}

}

}
Dave Kreskowiak 27-Dec-16 15:31pm
I'm not interested in your code.

At the same time, you are apparently not interested in learning how to code. You've been told time and time again to learn to use the debugger and you refuse to do it.