This thread is for C/C++ programming.
I’ll give you guyz an algorithm. Give me a C/C++ implementation of it. Here goes. Say I have a number 896235716. I need to validate this. Validation algorithm is like this.
From the last digit you start extracting. Here the last digit is 6. So you take number 6. Then you don’t take 1 but you take 7. Likewise extraction goes on.
8 9 6 2 3 5 7 1 6
8 6 3 7 6
multiply all the extracted digits by 2
8X2 = 16
6X2 = 12
3X2 = 6
7X2 = 14
6x2 = 12
Then add all the digits together.
1+6 + 1+2 + 6 + 1+4 + 1+2 = 24
if the total is divisible by 10 then its a valid number.
If 24mod10 !=0 then 896235716 is not a valid number.
say total is 20. Then 20mod10 ==0 so the corresponding number is valid.
Please note that validation number (896235716 in this case) can be varying in length. Extraction always starts from the last digit. If you have doubts on this let me know.
mama example valid number ekak dennum.
5482742451 number eka valid number ekak.
kattiya try ekak danna. good luck.






I’ll give you guyz an algorithm. Give me a C/C++ implementation of it. Here goes. Say I have a number 896235716. I need to validate this. Validation algorithm is like this.
From the last digit you start extracting. Here the last digit is 6. So you take number 6. Then you don’t take 1 but you take 7. Likewise extraction goes on.
8 9 6 2 3 5 7 1 6
8 6 3 7 6
multiply all the extracted digits by 2
8X2 = 16
6X2 = 12
3X2 = 6
7X2 = 14
6x2 = 12
Then add all the digits together.
1+6 + 1+2 + 6 + 1+4 + 1+2 = 24
if the total is divisible by 10 then its a valid number.
If 24mod10 !=0 then 896235716 is not a valid number.
say total is 20. Then 20mod10 ==0 so the corresponding number is valid.
Please note that validation number (896235716 in this case) can be varying in length. Extraction always starts from the last digit. If you have doubts on this let me know.
mama example valid number ekak dennum.
5482742451 number eka valid number ekak.
kattiya try ekak danna. good luck.






Last edited:







