I need to add the digits on the even and odd places in an integer. Say,
Let number = 1234567
.
Sum of even place digits = 2+4+6 = 12
Sum of odd place digits = 1+3+5+7 = 16
Wait, don't jump for an answer!
I'm looking for codes with minimal lines, preferably one-line codes. Similar to what 'chaowman' has posted in the thread Sum of digits in C#.
Does anyone has some cool codes. Thanks.