I can but then if i ask them to input again after checking the second time I need to check again and so on untill i have a lot of repeating code...
I think.
Unless im thinking about it totaly wrong. I need to always ask and validate untill they input the correct value.
Code:
#include <stdio.h>
int main( void )
{
char number_res[1000];
int temp;
printf( "enter number of resistors\n" );
scanf( "%s", number_res );
while(number_res[temp] < 48 || number_res[0] > 57 || number_res[1] < 48 || number_res[1] > 57){
printf( "Please enter numbers \n" );
printf( "enter number of resistors\n" );
scanf( "%s", number_res );
}
printf("Number was %d\n", atoi(number_res));
return 0;
}