Fortran Wiki
Validate Credit-Debit card Fortran program

Credit cards. Nearly everybody has at least one. Its not wrong to say that credit cards are life lines of worlds financial system.

But how many of you know what those numbers really mean? Contrary to what you may think, they aren’t random. Those 16 digits are there for a reason and, knowing a few simple rules, we can actually learn a lot about a credit card just from its number.

Head to this infographics to crack that code. And check the below mentioned Fortran program to Validate any credit and debit card number.

PROGRAMCREDITCARD! Program to Validate a credit or debit card number! coded by Sukhbinder Singh! based on http://www.mint.com/blog/trends/credit-card-code-01202011/CHARACTER(LEN=16)CCNINTEGERICCN(16),ODD(8),EVN(8)WRITE(*,'(A)',ADVANCE='NO')"ENTER YOUR CREDIT CARD NO : "READ(*,'(A16)')CCNDOI=1,16READ(CCN(I:I),'(I1)')ICCN(I)ENDDOODD=ICCN(1:16:2)ODD=ODD*2CALLSUMODDEVN=ICCN(2:16:2)IF(MOD(SUM(EVN)+SUM(ODD),10) .EQ.0)THENWRITE(*,*)"THE CREDIT OR DEBIT CARD NO IS VALID!"ELSEWRITE(*,*)"THE CREDIT OR DEBIT CARD NO IS INVALID!"ENDIFCONTAINSSUBROUTINESUMODDDOI=1,8IF(ODD(I) .GE.10)THENK=ODD(I)-10ODD(I)=1+KENDIFENDDOENDSUBROUTINEENDPROGRAM