I need to add the digits on the even and odd places in an integer. Say, Let number be = 1234567 Sum of even place digits = 2+4+6 = 12 Sum of odd place digits = 1+3+5+7 = 16
Wait, dont 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 (http://stackoverflow.com/questions/478968/sum-of-digits-in-c).
Does anyone has some cool codes. Thanks.