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
nevsk [136]
3 years ago
15

Assume the int variables i, lo, hi, and result have been declared and that lo and hi have been initialized. Write a for loop tha

t adds the integers between lo and hi (inclusive), and stores the result in result. Your code should not change the values of lo and hi. Also, do not declare any additional variables -- use only i, lo, hi, and result.
Computers and Technology
1 answer:
IRISSAK [1]3 years ago
4 0

Answer:

result=0;

for (i=lo ; i<=hi; i++){

result += i;

}

Explanation:

The question says result was declared but not initialized, so using result without initializing it to 0 would throw an error as result would be undefined and you can't add a number to undefined

Another way to do it to keep everything inside the loop would be

for (i=lo ; i<=hi; i++){

if (i==lo) result= 0;

result += i;

}

but this is impractical since it would add unnecesary operations in each cycle of the loop

You might be interested in
If you do not use the mini toolbar, it remains on the screen. _______________​ Group of answer choices True False
Digiron [165]

Answer:

The answer is "False".

Explanation:

The mini toolbar is a part of the windows and other operating systems, which available on the editing tool. It is also known as a toolbar, that is often shown with the right mouse.

  • This toolbar gives you access to the most popular configuration functions and is shown over the take-down shortcut menu.
  • It validates and becomes successful as you shift the cursor to the mini toolbar.

4 0
3 years ago
What is the role of the W3C? Group of answer choices oversee research and set standards for many areas of the Internet supervise
Murljashka [212]

Answer:

oversee research and set standards for many areas of the Internet

Explanation:

World Wide Web Consortium was created to maintain a standard order in the cyber world. It is an international community formed by the organizations as a member. W3C sets the standards of the websites and enables them to function and appear the same in every web browser. A specific standard of guidelines, rules, and protocols are fixed so that the World Wide Web can function and grow respectively.

5 0
3 years ago
PLEASE HELP! WILL MARK AS BRAINLIEST JavaScript can be implemented using the _________ HTML tags in a web page.​
Keith_Richards [23]

Answer:

JavaScript can be implemented using JavaScript statements that are placed within the ...  HTML tag

Explanation:

8 0
2 years ago
Read 2 more answers
Tanner is creating a brochure for his Web-hosting company. He designed the layout and placed a picture in the center of the page
Romashka [77]
Resizing is a very simple process. On the photo editing program, simply click on the image, and if resize handles appear around it, click and drag those to the desired size. If the program has a dedicated resizing or rescaling tool, use it and follow the above instructions. Keep the photo proportionate by holding down the shift key while dragging a corner handle. <span>Tanner has to make sure that his photo his of a high enough resolution to resize. A pixellated or blurry photo will only get worse when scaled up. He also has to make sure he doesn't resize it to be too big or it will also end up pixellated.</span>
5 0
3 years ago
When conducting research on the internet, what is a starting point for determining how to start the research?
Alex787 [66]
It depends on what you're researching for.
4 0
3 years ago
Other questions:
  • business owners and managers may first balk at the idea of mobile officer workers because there may appear to be a lack of ___ w
    9·1 answer
  • It is generally safe to provide your social security number to
    7·2 answers
  • 1. The future of 2D animation does not include hand-drawing. (1 point)
    13·1 answer
  • You start up your laptop while getting a coffee across the room. You hear the usual chimes and doinks as it starts up. When you
    14·2 answers
  • A(n) _________ is any system resource that is placed onto a functional system but has no normal use for that system. If it attra
    15·1 answer
  • For this exercise, you'll use the Rectangle class below (you can assume that the length and width are measured in feet).
    12·1 answer
  • What tool should you use to look for information on a network?
    14·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    15·2 answers
  • These brainly bots need to stop!!
    14·1 answer
  • with a ____ the traffic of a given enterprise or group passes transparently through an internet in a way that effectively segreg
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!