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
Which of the following is planted on an infected system and deployed at a predetermined time?A. Logic bombB. Trojan horseC. Worm
nekit [7.7K]

Answer:

A. Logic Bomb.

Explanation:

A Logic Bomb is a piece of code that is planted in a software system that is infected intentionally to set off malicious function.They are deployed at a predetermined time.

For ex:- a programmer hiding the files that deletes details of the employee who left the company.So these files can never be deleted.

4 0
3 years ago
What versions of Wi-Fi Protected Access (WPA) were defined after the IEEE ratified the IEEE 802.11i security standard
aliya0001 [1]

Answer:

John is good in math rewrite it and punctuate

8 0
3 years ago
Disadvatage of using a computer when you don't have knowledge about it​
shtirl [24]

If you mean you have no knowledge of the subject you're supposed to be researching, than that's the disadvantage, because you will have many,many different pages for what the search engines can relate what you're searching on to what it hints will help.

Disadvantages of using a computer when you don't know how to use a computer.

You don't know how to use a computer.

7 0
4 years ago
Which dhcp client option is used to provide a list of domain names to use in name resolution queries?
Rama09 [41]
Name resolution is done using DNS servers. DHCP provides a client with a list of DNS servers via option 6, "DNS Server".
4 0
4 years ago
Select the correct answer.
Akimi4 [234]

Answer:

A. Alphanumerical key

Explanation:

pl please give me points

7 0
3 years ago
Other questions:
  • The main circuit board in a computer is called the ________. RAM dongle motherboard power supply unit
    14·1 answer
  • How do all apple phones work?
    7·1 answer
  • Which Command Prompt commands in Windows is used for listing a computer connections to shared resources
    10·1 answer
  • Refer to the color wheel to identify the color scheme.
    13·1 answer
  • Of the key reasons for creating organizational units which of the following is not one of them?
    13·1 answer
  • Dell Computers is a nationally recognized manufacturer of computers for the small business and home markets. If Dell were to ord
    9·1 answer
  • Write a MASM program to calculate Fibonacci numbers:
    10·1 answer
  • How does AI use data
    7·1 answer
  • Do you think the current video game industry is likely to experience another “crash” (similar to the one in the 1980s) any time
    10·1 answer
  • what technique, in which multiple phones take turns sharing a channel, does the global system for mobile communications (gsm) us
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!