Can someone help me with problem set 1? I got the pyramid working, but my height restrictions seems to not work.
When I type in letters and negative numbers for height
, the program does not print out the diagram and keeps asking the user for another number. However, when I type a number that's greater than 23, it prints the pyramid out when it shouldn't print anything out, but instead ask the user for another number between 0 and 23.
Below is a snippet of my code. Is there a mistake?
int main(void)
{
int height;
do
{
printf("height: ");
height = GetInt();
....
} while(height>=0||height<=23);
}