Go Back

Credit Card Validator

Created: May, 2022

Credit Card Validator

The program prompts the user to enter a credit card number and validates it using the Luhn algorithm. It checks the validity of the credit card number based on the following steps:

1. It ensures that the input contains only numeric characters.

2. It doubles every second digit from the right, starting with the second- to - last digit.

3. If the doubled digit is greater than 9, it adds the digits of the doubled number together.

4. It sums up all the digits in the credit card number, including the doubled digits.

5. If the total sum is divisible by 10, the credit card number is considered valid.

Made with:

C++

Let's Connect

Feel free to connect with me anytime! Whether you want to chat about collaboration, share a fun fact, or just catch up, don't hesitate to drop me a message on social media or shoot me an email. Looking forward to hearing from you!