While classifying, I could see MasterCard being correctly spotted but not Visa (not checked yet Amex).
//check for American Express
if ((firsttwodigits == 34 || firsttwodigits == 37) && (i == 15))
{
printf("Amex");
}
//check for MasterCard
if (i == 16 && (firsttwodigits / 10 == 5) && (firsttwodigits % 10 == 1 || firsttwodigits % 10 == 2 || firsttwodigits % 10 == 3 ||
firsttwodigits % 10 == 4 || firsttwodigits % 10 == 5))
{
printf("MasterCard");
}
//check for Visa
if ((i == 16) && (firsttwodigits % 10 == 4))
{
printf("Visa");
}
Reply
https://edstem.org/us/courses/176/discussion/708180?comment=1644439[learn_press_profile]