I want the user to be able to immediately re-enter another value if the value originally entered is less than 0 or more than 23. Currently, my code outputs "please re-enter a value less than 24" and stops. It then has to be run again before the user can re-input another value.
{
printf ("What is the height of the half-pyramids?\n");
int height = get_int();
if (height>23)
{
printf("please re-enter a value less than 24\n");
}
else if (height<0)
{
printf("please re-enter a value more than 0\n");
}
else
{
printf("%i", height);
}
}