NOTE : I AM USING STRING INSTEAD OF LONG LONG TO STORE CC.
:) credit.c exists
:) credit.c compiles
:) identifies 378282246310005 as AMEX
:) identifies 371449635398431 as AMEX
:) identifies 5555555555554444 as MASTERCARD
:( identifies 5105105105105100 as MASTERCARD \ expected output, but not "Retry:\n"
:( identifies 4111111111111111 as VISA \ expected output, but not "Retry:\n"
:( identifies 4012888888881881 as VISA \ expected output, but not "Retry:\n"
:( identifies 1234567890 as INVALID \ expected output, but not "Retry:\n"
:( rejects a non-numeric input of "foo" \ expected prompt for input, not exit code of 0
:( rejects a non-numeric input of "" \ expected prompt for input, not exit code of 0
https://sandbox.cs50.net/checks/6c271d406e8f4ceabd15647a6d55e472
Why is 5105105105105100 a MC ? Its invalid based on the algorithm : 25%10 is not equal TO ZERO SO WHY ITS LISTED AS mASTERCARD ?
4111111111111111 is listed as VISA. But 27%10 is not equal to ZERO so it should invalid and not a VISA.
Either I misunderstood the algorithm or these paypal sample are wrongly listing some of these credit card numbers as valid. PLEASE HELP !