Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

What is the output of the following Java code (Assume all variables are properly declared and the input is 3 7 4 -1 [Note: four inputs]). num =...

What is the output of the following Java code (Assume all variables are properly declared and the input is 3 7 4 -1 [Note: four inputs]).

num = console.nextInt();

sum = num;

while (num != -1)

{

             num = console.nextInt();

             sum = sum + num;

}

System.out.println(sum);     

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question