A simple C++ program to validate credit card numbers, using Luhn's Algorithm.
Luhn's algorithm determines whether or not a credit card number is valid. For a given credit card number:
- Double the value of every other digit from right to left, beginning with the penultimate digit.
- Add the digits of the results of Step 1 to the remaining digits in the credit card number.
-
- If the result mod 10 is equal to 0, the number is valid.
- If the result mod 10 is not equal to 0, the validation fails.
Run the file named Credit_Card_Validator.cpp
.