Skip to content

Commit

Permalink
Update mario.c
Browse files Browse the repository at this point in the history
Added return 0;
  • Loading branch information
venturidb committed Nov 17, 2015
1 parent 4284f09 commit b1423b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pset1/mario.c
Expand Up @@ -16,11 +16,11 @@ int main(void)
// requests an integer from the user until the height requirement is satisfied
do
{
printf("Please give me an integer between 1 and 23: ");
printf("Please give me a non-negative integer no greater than 23: ");
height = GetInt();
}
while (height < 1 || height > 23);
printf("Thank you for the integer!\nHere is Mario's half-pyramid of height %i:\n", height);
while (height < 0 || height > 23);
printf("Thank you for the valid integer!\nHere is Mario's half-pyramid of height %i:\n", height);

// the top row needs two hashes
width = height + 1;
Expand All @@ -34,7 +34,8 @@ int main(void)
printf(" ");
else
printf("#");
}
}
printf("\n");
}
}
return 0;
}

0 comments on commit b1423b2

Please sign in to comment.