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
Six causes of data lost
Serhud [2]
Hard drive failures

Accidental deletions

Computer viruses and malware infections



Power failures
6 0
3 years ago
Which shot is not the best for a widescreen image
balu736 [363]
Portrait landscape is better for wide images
6 0
3 years ago
Gino has purchased a secondhand laptop. It came preinstalled with various application software and system tools. Which tools can
Jet001 [13]

Answer:

The answer to this question is given below in the explanation section

Explanation:

This question is about matching the column. So, Gino used the various preinstalled application software and system tools for the following purposes.

Disk cleaner: Gino needs to locate unnecessary files that are taking up a considerable amount of space.

Data recovery:  Gino notices many corrupted files and wants to extract good data from them.

Utility diagnostic program: Gino needs to check the operational status of the computer's hardware and software.

Antivirus: Gino's system is acting odd after browsing the internet, and he needs to scan the system.

7 0
3 years ago
What is your favorite coler and what do you like to do and
KIM [24]

Answer:

Orange

Explanation:

I like orange because its vibrant.

7 0
3 years ago
Kathy is a senior teacher in her school. She is conducting a group discussion between parents and teachers. Her role is to ensur
Fynjy0 [20]
She is the leader of the discussion
3 0
3 years ago
Read 2 more answers
Other questions:
  • Earning wise scope of web and mobile app development
    11·1 answer
  • Drivers should scan 10-12 secound down the road looking of potential hazards
    5·1 answer
  • Sally thought of adding a new paragraph after the
    6·1 answer
  • Use the drop-down menus to complete the statements about using column breaks in word 2016
    13·2 answers
  • Computer __ is any part of the computer that can be seen and touched​
    6·1 answer
  • PLEASE HELP! :)
    14·1 answer
  • Which data validation alert style should you use to prevent the user from entering invalid data?
    9·1 answer
  • Provide 3to 4 sentence overview of microsoft windows features?
    10·1 answer
  • when using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the .
    8·1 answer
  • T/F static development is the process of constructing the programs and code modules that serve as the building blocks of the inf
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!