I have a string of numbers, for example 12458960. How can I go about adding them so that it would be 1+2+4+5+8+9+6+0 = 35
I have the numbers already recorded into a variable called ccn. I just need to get the sum now. I tried adding the string numbers using,
ccn[0]+ccn[1]+ccn[2]+ccn[3]+ccn[4]+ccn[5]+ccn[6]+ccn[7]
But that didnt work.
Any help would be much appreciated.