Oddly evenProblem statementGiven a maximum of 100 digit number as input, find the difference between the sum of oddand even position digitsInput-1 04567Expected outputExplanationSum of odd position digits 4 and 6 is 10. Sum of even position digits 5 and 7 is 12. Thedifference is 12 - 10 = 2Input-29834698765123Expected outputInput-35476Expected output
Answers
Answered by
0
Answer:given input is 4567
odd postions 4,6 :4+6=10
even postions 5,7:5+7=12;
even-odd=12-10=2
Explanation:hence proved !
Attachments:
Similar questions