Question: java Q1- Write a program that prompts the user to input a positive integer n. It should then display the sum of all the numbers
java
Q1- Write a program that prompts the user to input a positive integer n. It should then display the sum of all the numbers from 1 to n.
Q2- Write a program that prompts the user to input a positive integer n. It should then display the sum of all the even numbers from 1 to n and the sum of all the odd numbers from 1 to n.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
