Suppose that the input is 38 45 71 4 -1. What would the output of the code below
ID: 3619257 • Letter: S
Question
Suppose that the input is 38 45 71 4 -1. What would the output of the code below be, if all variableswere 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); Suppose that the input is 38 45 71 4 -1. What would the output of the code below be, if all variableswere 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);Explanation / Answer
Suppose that the input is 38 45 71 4 -1. What would the output of the code below be, if all variableswere properly declared?sum num j
sum = console.nextInt(); 38
num = console.nextInt(); 45 for (j = 1; j <= 3;j++) 1
{ num = console.nextInt(); 71
sum = sum +num; 109 2
} 4
System.out.println("Sum = " +sum); 113 3
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.