Coders Packet

Card Number Detailer using C++

By Raghav Ambashta

  • Card-Detailer.exe
  • Card-Detailer.cpp
  • This packet is a C++ program to depict a card number. It will validate the card number and will categorize it.

    Run Card-Detailer.exe in the terminal and enter your 16 digits card number.


    Working of the application


    The program will first verify is the card number is valid or not using Luhn Algorithm.

    If the card number is valid, it will further depict the card number and categorize it to the issuer to which it belongs.

    If the card number is invalid, then it will prompt the user to re-enter the card number, and then it will follow the verification process again.

    The first digit of the card number tells about the category of the issuer.
    The relation of the first digit and the category to which the card belongs is:
    0 – ISO and industry assignments
    1 & 2 – Airline cards
    3 – Travel and Entertainment
    4 - Visa
    5 - Mastercard
    6 – Merchandising and Banking
    7 – Petroleum
    8 – Telecom
    9 – Assignments by National Standards Bodies

    To view the code open Card-Detailer.cpp in any IDE.


    Download Complete Code


    No comments yet