I'm using Luhn's algorithm for a credit card program. Part of the algorithm requires me to double the number that's two places from the right of the credit card number, and continue two palces to the left until I reach the end of the credit card number, and then add everything. But if one of the numbers I double is a double digit, for example 10, then I would have to add 1+0=1 instead of 10 to the total sum. I don't know how I would include this into the function that is in charge of this arithmetic. Any help is appreciated.
Well, first you should read over the C++ tutorial on this website, get familiar with the language, try examples, modify those examples, and run the code to see if it works.
I was assuming when you said "I don't really know how to put that into a program" that you don't understand the concepts of variable and data types and the various operations you can do with them like addition, subtraction, and so forth.
But since you've written most of the program, you know the basics.
There's isn't any section that would specifically help with the problem that I've given you.
However, you should look into the modulus operator (%) which can help you.