My mario project prints exactly what is supposed to but cs50 is not passing it, for numbers 2,and above and when i look at the link for the bug their output is exactly same as mine. Did someone run to the same problem. here is my code snippet below:
int main(void)
{
int usernum;
// making sure user input a number between 1 to 23
do{
printf("Height: ");
usernum = GetInt();
}while(usernum > 23 || usernum < 0);
for(int column = 0,space = usernum; space >= 0 ||
column <= usernum; column++,space--)
{
for(int row = 0; row < space ; row++)
{
// checking to see if we have reached the end of space
if(row + 1 == space)
{
// if yes then start printing the hashes :).
for(int row = 0; row <= column + 1; row++)
{
printf("#");
}
}
printf(" ");
}
// making sure to print one less next line then user's input
if(column < usernum)
{
printf("\n");
}
}
return 0;
}