My code seems to be working but I keep failing on check50. As an example, I get this back from check 50:
:( handles a height of 1 correctly \ expected output, but not "#\n" :( handles a height of 2 correctly \ expected output, but not " #\n##\n
I'm not sure what is going wrong, any ideas? My code is as follows:
//get user input int n;
do {
printf("Give me a positive integer no greater than 23.\n");
n = GetInt();
}while(n > 23 || n < 0);
//build pyramid for (int i=0; i < n; i++) {
for (int a=i+1; a < n; a++)
{printf(" ");}
for (int b=n-i; b > 0 && b <= n; b++)
{printf("#");}
printf("\n");
}
}
Thanks!