Is there any way to define a variable for example that only accepts one values from 1 to 100?
If the user try to assign a value that is out of this interval the program signs an error.
I'm not looking for an algorithm of input control, like this:
#include <stdio.h>
int main ( ) {
int n ;
printf("give an interger number between 1 and 100 : ");
scanf("%d",&n);
while ( n < 1 || n > 100 )
{
printf("given value is wrong\ngive a new value between 1 and 100 : ");
scanf("%d",&n);
}
return 0 ;
}