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
9966 [12]
3 years ago
10

Assume the int variables i,lo, hi, and result have been declared and that lo and hi have been initialized. Assume further that r

esult has been initialized to the value 0. Write a for loop that adds the integers from lo up through 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:
Naddik [55]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main() {

   int i,lo=12,hi=45,result=0;//all the variables declared..

   for(i=lo;i<=hi;i++)//for loop.

   {

       result+=i;//adding integers to sum..

   }

   cout<<result<<endl;//printing the result.

return 0;

}

Output:-

969

Explanation:

The above-written program is in C++.The variables i,lo,hi,result are declared first only lo,hi,result are initialized.Then a for loop is used to iterate over the values from lo to hi for that i used and the value of every integer is added to the result.

You might be interested in
Which range function creates the following list of numbers?<br> 76 74 72 70 68 66 64 62
baherus [9]

Answer:

they look like even number

Explanation:

2 4 6 8 10 12 -------seeeeee but not hundred percent sure but plz put me in brainlist

4 0
3 years ago
USB flash drives are small portable units that are used to ____________files.
Juliette [100K]

Answer:D

Explanation: they do all of these

3 0
4 years ago
Read 2 more answers
A drowsy cat spots a flowerpot that sails first up and then down past an open window. The pot is in view for a total of 0.50 sec
GaryK [48]

Answer:

2.342m

Explanation:

Given

Time = 0.5 s

Height of Window = 2m

Because the pot was in view for a total of 0.5 seconds, we can assume that it took the cat 0.25 seconds to go from the bottom of the window to the top

Using this equation of motion

S = ut - ½gt²

Where s = 2

u = initial velocity = ?

t = 0.25

g = 9.8

So, we have.

2 = u * 0.25 - ½ * 9.8 * 0.25²

2 = 0.25u - 0.30625

2 + 0.30625 = 0.25u

2.30625 = 0.25u

u = 2.30625/0.25

u = 9.225 m/s ------------ the speed at the bottom of the pot

Using

v² = u² + 2gs to calculate the height above the window

Where v = final velocity = 0

u = 9.225

g = 9.8

S = height above the window

So, we have

0² = 9.225² - 2 * 9.8 * s

0 = 85.100625 - 19.6s

-85.100625 = -19.6s

S = -85.100625/19.6

S = 4.342

If 4.342m is the height above the window and the window is 2m high

Then 4.342 - 2 is the distance above the window

4.342 - 2 = 2.342m

6 0
3 years ago
Why does coinbase keep sending me verification codes
DIA [1.3K]

Answer:

i dont know

Explanation:

8 0
3 years ago
Hannah decides to burn her video portfolio to a DVD. She wants to hand it over to a movie producer she will meet at a social eve
Gwar [14]
C maybe I am not sure this
7 0
3 years ago
Other questions:
  • A. True
    5·1 answer
  • Each processor or core processes two threads at the same time is called _________.
    5·1 answer
  • Which objects with developed to help astronomers to learn more about the sun
    12·1 answer
  • (Bible)<br> Sin may be an inward thought or an outward act. True False
    11·2 answers
  • Identify whether each of the following goals would be a short-term or long-term goal for a high school senior who will graduate
    12·2 answers
  • The long-run average cost curve is typically _______________________. a) downward-sloping at first but then b) upward-sloping up
    14·1 answer
  • PLEASE HELP THANK YOU
    7·1 answer
  • Write the definition of a void function that takes as input two integer values, say n and m. The function returns the sum and av
    9·1 answer
  • What method does a gsm network use to separate data on a channel?
    12·1 answer
  • PLEASE HELP ASAP what is the main purpose of electronic speed controller ESC
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!