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
Analog signals consists of individual electric pulses that represents bits group together into bytes {True/False}
Maru [420]

Answer:

The answer would be true

Explanation:

Hope this helps. Please mark me Brainliest

6 0
4 years ago
Which line in the following program contains the header for the showDub function? 1 #include 2 using namespace std; 3 4 void sho
Flura [38]

Answer:

The answer to this question is "15 line".

Explanation:

A function is a block of ordered, portable code used to perform a single, connected operation. The syntax of function declaration can be given as:

Syntax :

returntype functionName(parameter1, parameter2); //function prototype

or declaration

returntype functionName(parameter1, parameter2) //function definition or header of the function  

{  

//function body.

//function implementation

 //return value;

}

In the given question the header of the showDub function is on line 15.

That's why the answer to this question is "15 line".  

8 0
3 years ago
Drag the tiles to the correct boxes to complete the pairs.
arlik [135]

Smart devices is a technology trend, interest in renewable energy is a social trend, and buying solar panels and generators is a consumer trend.

4 0
3 years ago
Read 2 more answers
Data validation is the process of a. preventing errors due to invalid data b. preventing errors due to incorrect Transact-SQL sy
professor190 [17]

Answer:

The correct answer to the following question will be "Option A".

Explanation:

Data validation seems to be an important part of every data managing mission unless you are in that area of information or data collection, data processing or planning to deliver the information to stakeholders.

  • Validation could be viewed as something of an integral component of your process instead of as a further move.
  • If your data set isn't correct from the beginning, then your outcomes will undoubtedly not be correct either. That's why the data needs to be checked or tested until it becomes used.

The other three options are not related to the given topic. So Option A is the right answer.

6 0
4 years ago
Why are you unable to modify the budget file, when you have the allow full control ntfs permission? 70-410?
Serggg [28]

Reason is because from this machine, I only have READ permissions and still in the Domains users. I should have full access in the share permission “Student” becomes a part of the Domain Users group in share permission. In this group, only READ permission is allowed.

 

3 0
3 years ago
Read 2 more answers
Other questions:
  • Some might consider careers in the Construction industry to be quite flexible. Which statement supports this claim? Employees ca
    14·2 answers
  • Which tag you will use to explain a set of in an HTML document?
    6·1 answer
  • The factorial of an integer N is the product of the integers between 1 and N, inclusive. Write a while loop that computes the fa
    10·1 answer
  • What is this effect in photoshop or photography?
    12·2 answers
  • Where do players resurrect if they have been destroyed in a game?
    13·1 answer
  • What are some things all boomers say.
    12·2 answers
  • Need answer ASAP!!!!!
    6·1 answer
  • so i am on a Chromebook with headphones , and I am wondering if you can make it that a tab only play sound on one side of the he
    12·1 answer
  • Fill the labels!! Please quickly I need help quickly
    9·1 answer
  • When delivering 2023 murano, demonstrate how to turn the driver assistance technologies on or off using ________.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!