Question: JAVA A number is given as input. Find the odd digits in the number, add them and find if the sum is odd or not.if

JAVA

A number is given as input. Find the odd digits in the number, add them and find if the sum is odd or not.if even return -1, if odd return 1 input:52315 logic:5+3+1+5=14(even) output:-1 input:1112 logic:1+1+1=3(odd) output:1

JAVA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!