So the program sends the input value to the function is_digit. On its return it checks to see whether it = -1:
Code:
for(i=1;i<=6;i++)
{
if (i=1)
{
//scan for number, send to is_digit
}
else if (i=2)
{
//scan for number, send to is_digit
}
else if (i=3)
{
//scan for number, send to is_digit
}
else if (i=4)
{
//scan for number, send to is_digit
}
else if (i=5)
{
//scan for number, send to is_digit
}
else if (i=6)
{
//scan for number, send to is_digit
}
if(result==-1)
{
printf("One or more entries contained symbols other than numbers. Please re-enter the data\n");
continue;
}
else
{
printf("Ok value is:%d\n",result);
}
}
}
But the for loop doesnt increase i by 1 so it still tries to scan and store in the same spot each time.
also, what if the entered number is a decimal i.e 0.67 or a negative -43
it wont like that will it?