Question: Write a Java program with loop that ask user to enter a positive integersn.The program should display all the even numbers from 2 to n
Write a Java program with loop that ask user to enter a positive integersn.The program should display all the even numbers from 2 to n and also display the sum of all even numbers from 2 tonin the following format.For example, if the value ofnis 9, you program should display
2+4+6+8 = 20
Sample input/output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
