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
In this screenshot, the circled item is the
gavmur [86]

Answer:

Favorites tab/bar

Explanation:

6 0
3 years ago
Read 2 more answers
Which is the best tip for optimizing a TrueView video for viewer engagement?
Ivenika [448]

Answer: (A) Look at engagement rate for targeting and focus on the methods with the highest view through rate

Explanation:

TrueView video enables to post ads in social sites however it is paid by the sponsor only if the ad is viewed fully or in some cases it is viewed only upto 30s of the total size of the video.

So in order to have a larger viewer engagement it is necessary for it to focus on the methods which would garner it highest views.

So option A is correct.

Option B and c are not correct these options would not cater to the needs of the viewer.

5 0
3 years ago
You can separate words in a macro name by using the ____ character
Maru [420]
You can separate words in a macro name by using the underscore character.

A macro is considered as a small reusable computer program. It is efficient as it helps you save time by automating any repeated task.
In order to create a macro, you do not need to be an expert in programming, however, a little knowledge about it will help.

8 0
3 years ago
Read 2 more answers
Which of the following is least likely to be a scientific experiment
Dennis_Churaev [7]

Answer:

what causes gravity to have a amount of force on one object but not another

Explanation:

3 0
3 years ago
Device management is the process of managing what kinda devices? :)
Anika [276]
Device management is the process of managing "Physical Devices" like <span>ports and interfaces of a computer or server

Hope this helps!</span>
4 0
3 years ago
Other questions:
  • Julie bought a house for $315,000 and has a $285,000 mortgage. she claims she has $315,000 in equity. is she correct? if not, ho
    12·2 answers
  • Select all statements that correctly describe the ramifications of important features supported by modern DBMS.
    15·1 answer
  • 2. Billys teacher asked him to type a report about asian food. Which paragraph format should he use?
    12·2 answers
  • How to make a Tip Calculator in code?
    12·1 answer
  • How to learn python ?
    13·1 answer
  • Question 1:
    5·1 answer
  • Jamal wants to write a program that will find the 10 most common words in Romeo and Juliet. Which of the following constructs wi
    5·1 answer
  • Which part of the brain controls the movement of muscles​
    6·1 answer
  • How would you want to change the copyright laws?
    11·1 answer
  • Place the steps in order for creating a filter in Outlook 2016.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!