Question: Write a Java program that prompts the user to enter an integer. The program should calculate and display the sum of the odd digits in

Write a Java program that prompts the user to enter an integer. The program
should calculate and display the sum of the odd digits in the entered number.
Marks 4
Sample Input Sample Output
1357925
123459
2. Write a Java program that prompts the user to enter an integer representing the
number of rows. The program should then print two patterns as follows:
Marks 6
Sample Input Sample Output
4 Pattern 1:
1
12
123
1234
Pattern 2:
1
22
333
4444

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 Programming Questions!