Skip to content
Advertisement

Need to find even sums of digits in the array

I need to find even sum of digits from an array in Java.

JavaScript

Output: 8 10

Process:

3 + 4 == 7 –> not even

3 + 6 == 9 –> not even

3 + 5 == 8 –> even (so print it)

4 + 6 == 10 –> even (so print it)

4 + 5 == 9 –> not even

6 + 5 == 11 –> not even

Advertisement

Answer

If this is to check two value combination, you can use something like the below,

JavaScript

and the output will look like this

JavaScript
Advertisement