How to prevent users from typing incorrect inputs ?
- by ZaZu
Hello,
I want the program to loop a scan function if the user types anything else other than numbers..
My code is :
do{
printf("Enter rows\n");
scanf("%d",&row);
}while(row>='a' && row<='z');
but this code doesnt work .. I keep getting an error when typing in a letter. I tried manipulating around it and the whole thing loops infinitely ...
What am I doing wrong ?
Please help
thanks !