wap to input a number and dissplay sum of even digits of number
Answers
Answered by
0
Answer- Let N be the input number.
Initialize sum = 0.
Repeat the following steps while N > 0. Set r = N % 10. Store the rightmost digit of N in r. Set N = N / 10. Remove the rightmost digit of N. If r is even, set sum = sum + r. If r is odd, do nothing.
The sum of even digits of N is stored in sum.
pls make me the brilintest
Similar questions