On pset1 I'm trying to make a do ... while
loop to get the user's input for the pyramid height for Mario. I swear it should be simple...
This is my source code for dowhile.c
:
#include <stdio.h>
#include <cs50.h>
int main(void)
{
printf("Please enter the half pyramid's height\n");
int pyramidHeight;
do {
pyramidHeight = GetInt();
} while (pyramidHeight < 0 || > 23);
}
What I think this should mean is something like: Do GetInt
(i.e., keep asking for the user's input) and if their input is less than 0 OR greater than 23, it should GetInt
again.
(i.e., pyramidHeight
must be 0 - 23 to move to the next bit of code)
Every time I try to compile it though I get this error:
dowhile.c:11:40: **error: expected expression**
} while (pyramidHeight >= 0 && <= 23);
I'm sure I must be doing something very basic wrong here, can anyone please help?