Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void runLuhn (int *ccNum, int *checksum)
- {
- int i;
- int store;
- int total;
- i = 0;
- store = 0;
- total = 0;
- for(i = 0; i < 16; i = i + 2)
- {
- ccNum[i] = ccNum[i] * 2;
- store = (ccNum[i] / 10) + (ccNum[i] % 10);
- ccNum[i] = store;
- }
- for(i = 0; i < MAXCCNUM-1; i++)
- {
- total = total + ccNum[i];
- }
- printf("%d\n", total);
- *checksum = total % 10;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement