answer.
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]
2 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]2 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
Emma wants to create a website that will contain mostly textual information pertaining to book reports she has to create. Which
Softa [21]

The language that will help her create a website structured in the form of headings and paragraphs of text would be HTML.

7 0
2 years ago
Read 2 more answers
The base class Pet has private fields petName, and petAge. The derived class Dog extends the Pet class and includes a private fi
Lapatulllka [165]

Answer:

Hello attached is the Java program written to solve the problem

The Pet.java and Dog.java files are unaltered

Explanation:

The input and output  codes are attached as well i.e the second image is the input while the third image is the output code

5 0
2 years ago
Which of the following is NOT a method in which a macro can be run?
liubo4ka [24]
C....................
7 0
2 years ago
What is the argument in this function =AVERAGE(F3:F26)
monitta
The argument for the function would be answer "D".
5 0
2 years ago
In a system where Round Robin is used for CPU scheduling, the following is TRUE when a process cannot finish its computation dur
masha68 [24]

Answer:

B. The process will be terminated by the operating system.

Explanation:

When Round Robin is used for CPU scheduling, a time scheduler which is a component of the operating system is used in regulating the operation. A time limit is set for each of the processes to be run.

So, when a process fails to complete running before its time elapses, the time scheduler would log it off and return it to the queue. This queue is in a circular form and gives each of the processes a chance to run its course.

7 0
2 years ago
Other questions:
  • Characteristics of a LAN include _____. can be connected to the Internet covers the most area of all networks does not have to b
    5·1 answer
  • Which description of the plain text file format is most accurate?
    11·2 answers
  • Why can't you use Friedman's attack on block ciphers?
    12·1 answer
  • Need 2.5 Code Practice Answers
    14·2 answers
  • FTP requires confirmation that a file was successfully transmitted to a client, but it has no built-in mechanism to track this i
    5·1 answer
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • When using the following symbol, there are two arrows coming out of it. One arrow corresponds to what happens in the program if
    7·1 answer
  • Sara is using her personal laptop (which is password protected) at a "hotspot" at a local cafe with wifi access. She is in the m
    7·1 answer
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    8·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!