How do i make a validating of only number and make characters invalid if entered. Using this method
#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#include<ctype.h>
int main()
{
int arr [100],el,number ;
// for(int i=0;i<100;++i)
//scanf("%d",arr[i]);
while( el == 0 )
{
printf("Enter a number between 1 to 100");
scanf("%d", &number );
if( (number < 1) || (number > 100) )
printf("Number is not valid\n");
else
el = 1;
}
printf("Number is %d\n", number );
fflush(stdin);
/*el=0;
while(el=0)
printf("Want to continue? (Y/N): ");
scanf("%c",&el);
el=toupper(el);
if ((el=='Y') || (el == 'N') )
el=1;
else
printf("\007ERROR: Invalid choice");*/
return 0;
}