Question: FOR JAVA Given the following declaration, write a segment of code using while loop to ask the user to input a sequence of positive integers
FOR JAVA
Given the following declaration, write a segment of code using while loop to ask the user to input a sequence of positive integers ending with a negative number, set the sum to be the sum of the positive numbers. int sum = 0; Scanner in = new Scanner(System.in);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
