I need to check that if the user input a value, the program runs only if the value is a positive integer between [1-8] (Inclusive), but if the input value is a letter or word or not input at all (Enter), the program ask again for an input
#include <stdio.h>
int main (){
int height;
do {
printf ("Height: ");
scanf ("%i", &height);
}
while (height < 1 || height > 8);
{ .
.
.
.
I was thinking to add another condition "|| (or)" in the while validation, something like while "height be different(!=) from an integer" then do...
But I can't figure out how to check that statement in other StackOverflow questions. I hope you can enlighten me