Question: Write a program that takes in an unknown number of integers until a 0 is inputted, and adds up all the numbers inputted. For example:

Write a program that takes in an unknown number of integers until a 0 is inputted, and adds up all the numbers inputted. For example: Input: 5 38-20 Output: 14 287956.1731522 LAB ACTIVITY 13.9.1: Addition with unknown inputs. 0/4 LabProgram.java Load default template... 1 import java.util.Scanner; 3 public class LabProgram { 4 public static void main(String[] args) { 5 Scanner scnr = new Scanner(System.in); 6 7 //your code here 8 9 } 10 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
