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
never [62]
3 years ago
11

The counter variable in the code below increments by 1 each time through the loop. What will the value of counter be after the f

ollowing loop executes?
var counter = 0;
var n = 6;
while(n > 0){
n = n - 2;
counter = counter + 1;
}
console.log(counter)
4

A. 0
B. 1
C. 2
D. 3
E. 4
Computers and Technology
1 answer:
Novosadov [1.4K]3 years ago
8 0

Answer:

The Value of the variable counter will be 3

Explanation:

The code snipped given in the question will execute only three times.

The value of counter will be increased by 1 afer each execution with the initial value of counter set to 0

The condition while n>0 will hold true at the first iteration when n=6. (counter will be increased to 1) and n is reduced by 2 (new value of n =4).

The condition while n>0 will hold true at the second iteration when n=4-2 =2. (counter will be increased to 2) and n is reduced by 2 (new value of n =2).

The condition while n>0 will hold true at the third iteration when n=2-2. (counter will be increased to 3) and n is reduced by 2 (new value of n =0).

At the fourth iteration, the condition becomes false as the value of n is now zero and 0 is not greater than 0. So the the condition becomes false with the value of counter = 3

You might be interested in
Two electronics technicians are looking at the testing instrument in the figure above. Technician A says that this instrument is
aleksklad [387]
I am pretty sure the answer is A.
4 0
3 years ago
Which operation is not efficiently supported by heaps?
vodka [1.7K]

In the case above, the operation is not efficiently supported by heaps is Find.

<h3>What are heap operations?</h3>

The operation that are known to often use heaps are:

  • Heapify
  • Find-max (or Find-min)
  • Insertion, etc.

Therefore, In the case above, the operation is not efficiently supported by heaps is Find.

See full question below

Which operation is not efficiently supported by heaps?

a. DeleteMin

b. Find

c. FindMin

d. Insert

e. all of the above are sufficiently supported

Learn more about operation from

brainly.com/question/24214198

#SPJ11

6 0
2 years ago
Explain why a document created by word processing software is stored as a binary file.​
Savatey [412]

Answer:

Refer below.

Explanation:

Binary DOC records regularly contain more content organizing data (just as contents and fix data) than some other document designs like Rich Text Format and Hypertext Markup Language, however are normally less broadly good.

The DOC documents made with Microsoft Word renditions contrast. Microsoft Word forms before Word 97 ("8.0") utilized an alternate organization from the OLE/CFBF-based Microsoft Word 97 – 2003.

In Microsoft Word 2007 and later, the binary document design was supplanted as the default position by the Office Open XML group, however Microsoft Word can in any case produce DOC records.

3 0
3 years ago
Match the installation type to its description.
MariettaO [177]

Answer:

Following are the types of installation matched to its respective definitions.

<h3>Upgrade installation:</h3>

What you do when you have a computer with an existing operating system that needs to be upgraded.

This means that while working on a window when you get attracted by the update introduced recently and you upgrade your window accordingly.

For example: Updating a window from 8 to 10 or desired features.

<h3>Multiple boot installation:</h3>

What you do when you have several operating systems on one computer.

In this type of installation, a computer has different windows for different accounts. You can boot to the desired installed window by switching account.

<h3>Clean installation:</h3>

What you do on a brand new computer that has never been set up before and does not have an operating system on it yet.

It can be defined as the installation of window done very first time on to the computer. Sometimes when the window gets deleted due to virus or any other factor, the installation at that time will also be termed as Clean Installation.

<h2>I hope it will help you!</h2>
5 0
3 years ago
How many fonts are there in a theme?<br> A. 1<br> B. 2<br> C. 4<br> D. 5
BlackZzzverrR [31]

B. 2

If incorrect, sorry

6 0
3 years ago
Other questions:
  • HELLLLLP ill make you brainiest and ill give u a lot of points if you HELP ME Directions Part One.
    12·2 answers
  • What is the subnet mask ?
    9·2 answers
  • ____ are programs that need to be attached to other files to install themselves on computers without the users’ knowledge or per
    5·1 answer
  • 1. In your own words, describe the purpose of a for a loop.
    11·1 answer
  • A trust domain is defined as Select one: a. The agreed upon, trusted third party b. A scenario where one user needs to validate
    5·2 answers
  • Image-editing software is used to_____
    7·1 answer
  • This finding maximum number function will keep on going until we reach at the last value
    12·1 answer
  • Read the following scenario. How might Sarah correct successfully complete her task?
    6·1 answer
  • There u go i did thereeeeeeeeeeeeeeeeeeeeeee
    13·2 answers
  • Rr lyrae stars pulsate, but with shorter periods and lower luminosities than cepheids. true false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!