1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
cluponka [151]
3 years ago
10

What is the output of the following code fragment? int i = 1; int sum = 0; while (i <= 11) { sum = sum + i; i++; } System.out

.println("The value of sum is " + sum); The value of sum is 65. The value of sum is 66. The value of sum is 55. The value of sum is 56.
Computers and Technology
1 answer:
valentina_108 [34]3 years ago
7 0

Answer:

The value of sum is 66

Explanation:

i = 1

sum = 0

while (i <= 11) {  

sum = sum + i;

i++;  

}

i = 1

  • sum = sum + i
  • sum = 0 + 1
  • sum = 1

i = 2

  • sum = sum + i
  • sum = 1 + 2
  • sum = 3

i = 3

  • sum = sum + i
  • sum = 3 + 3
  • sum = 6

i = 4

  • sum = sum + i
  • sum = 6 + 4
  • sum = 10

i = 5

  • sum = sum + i
  • sum = 10 + 5
  • sum = 15

i = 6

  • sum = sum + i
  • sum = 15 + 6
  • sum = 21

i = 7

  • sum = sum + i
  • sum = 21 + 7
  • sum = 28

i = 8

  • sum = sum + i
  • sum = 28 + 8
  • sum = 36

i = 9

  • sum = sum + i
  • sum = 36 + 9
  • sum = 45

i = 10

  • sum = sum + i
  • sum = 45 + 10
  • sum = 55

i = 11

  • sum = sum + i
  • sum = 55 + 11
  • sum = 66

i = 12 --> does not comply with the condition "i < = 11", the while loop is over

You might be interested in
One of the difficult things about working in game design is that while there are many different roles, most of them only match o
Papessa [141]

Answer:

it's false

Explanation:

they don't match to personalities

6 0
2 years ago
PLEASE HELP! WILL MARK BRAINLIEST!!
DaniilM [7]

Answer:

An apple a day keeps the doctor away...

3 0
2 years ago
Read 2 more answers
Which of the following statements is true? The try block contains the code that handles the exception if one occurs. When a try
Elenna [48]

Answer:

You can have many catch blocks to handle different types of exceptions.

Explanation:

In programming, catch and try are blocks of codes that are written to handle errors. While the try block of code will allow for the definition of code blocks which are tested for errors, the catch block of code allows the programmer to define the block of code to be executed if an error occurs in the try block.... somewhat like the if....else statements. since there could be different error handling scenarios,one can have as many catch blocks for different error exceptions

8 0
3 years ago
An administrator at ursa major solar is using sharing rules to grant record access to users. which two types of record access ca
My name is Ann [436]

Based on the above, The two types of record access can the administrator grant are:

C. Read/Write

D. Read Only

<h3>What is read write access?</h3>

This is seen as a kind of device that can both act as a kind of input and output or moves and receive.

Note that it is also seen as digital file that can be updated and deleted and therefore, Based on the above, The two types of record access can the administrator grant are:

C. Read/Write

D. Read Only

Learn more about record access from
brainly.com/question/8798580

#SPJ1

4 0
1 year ago
What is this <br>name which console it is ​
ZanzabumX [31]

Answer:

ps3

Explanation:

becaus with is and I'm right

6 0
2 years ago
Read 2 more answers
Other questions:
  • 2.Consider the following algorithm and A is a 2-D array of size ???? × ????: int any_equal(int n, int A[][]) { int i, j, k, m; f
    12·1 answer
  • Which of the following will not cause the supply of internet service to increase?
    15·1 answer
  • Computer Architecture
    7·1 answer
  • What is one reason that writing effective messages is so important
    11·2 answers
  • Riya wants to save her project work in an external device so that she can show it to her class teacher. Help her to choose the d
    13·2 answers
  • How do I do this??? (Im in 9th)
    7·1 answer
  • How long does an online snap application take to process ohio
    6·1 answer
  • Why we need to interpret the drawing and plans
    10·1 answer
  • The page that appears when you first open your Internet browser is the _____.
    8·1 answer
  • A(n) ____ is a live internet presentation that supports interactive communications between the presenter and the audience.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!