Having a little difficulty trying to figure out how to apply the check digit here. I need to be able to select a product item and check it with the "mod 10 check digit". If it fails then I need it to loop and prompt for the product number again. If zero is entered the the prog shoud terminate.
This is actually just a chunk of a project I'm working on...everything else makes sense now. Just need to be able to combine this stuff in there......
#include <stdio.h>
main()
{
int item_number;
while(item_number)
{
printf("\nEnter the item number (zero to quit) > ");
scanf("%i", &item_number);
if(item_number==0)
break;
else if(item_number<0)
/*this is where I want to apply mod check*/
printf("Invalid number, please re-enter.");
}
return 0;
}
If I can get the check digit in there, it will also prompt for a correct item number if alpha characters are entered, correct?
Thanks.