I have the following code for C
int get_pyramid_steps(string prompt);
//Ask height
int main(void)
{
int i = get_int("pick a number: ");
printf("you said %i\n", i);
}
//if i < 1 or i > 8
int get_pyramid_steps(string prompt)
{
int j;
do
{
j = get_int("%s", prompt);
}
while (j > 8 || j < 2);
return j;
}
The end goal is to make the user continually "say pick a number" for any >2 and < 8 but the following seems to be ignored
int get_pyramid_steps(string prompt)
{
int j;
do
{
j = get_int("%s", prompt);
}
while (j > 8 || j < 2);
return j;
}