Answer to Question #188421 in Java | JSP | JSF for Hamza

Question #188421

Suppose that the input is:


38 35 71 14 -1


What is the output of the following code? Assume all variables are properly declared.

sum = console.nextInt();

num = console.nextInt();

for (j = 1; j <= 3; j++)

{

num = console.nextInt();

sum = sum + num;

}

System.out.println("Sum = " + sum);



1
Expert's answer
2021-05-03T03:31:59-0400

output:

Please provide 5 digits and press Enter:38 35 71 14 -1

Sum = 157



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS