Reema K.

asked • 06/01/20

solution for this problem

Sum of Odd and Even Digits

Problem Statement :

Write a java program to calculate the sum of odd and even digits in a number. The input consists of a single integer 'n' which corresponds to the given number.The output must display the sum of odd numbers and even numbers.


Problem Constraints:

The datatype of integer must be long.

The file name must be Main.java


Sample Input and Output :


Enter the number

3924209420352

The sum of the odd digits are 29

The sum of the even digits are 16


 


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.