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
Andrej
1 month 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:
zubka84 [942]1 month ago
5 0

Answer:

#include <iostream>

using namespace std;

int main() {

   int i, lo=12, hi=45, result=0; // initializing the required variables..

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

   {

       result+=i; // accumulating the sum of integers..

   }

   cout<<result<<endl; // displaying the resulting total.

return 0;

}

Output:-

969

Explanation:

This program is written in C++. Initially, the variables i, lo, hi, and result are declared, with only lo, hi, and result initialized. A for loop is employed to loop through all values from lo to hi, adding each integer to the result.

You might be interested in
Which of the following best describes how computing devices represent information? A. A computer will either represent informati
oksian1 [797]

Answer:

The answer is B.

Explanation:

The justification for choosing B is that "bytes" represent the correct method for storing data in binary form of 0s and 1s.

5 0
1 month ago
Read 2 more answers
If a packet gets “sucked down a black hole” (figuratively speaking) and is not received by its sender, and no message is sent ba
Harlamova29_29 [932]

If a packet gets figuratively “sucked into a black hole” and is not received by the original sender, with no message returned to clarify the situation, there is an issue. This lack of communication indicates there is a problem with the _____.

A.) ICMP

B.) TCP/IP

C.) HTTP

D.) ISO

A.) ICMP

I hope this information is useful and wish you the best.

~May

0 0
1 month ago
Which type of testing is done when one of your existing functions stop working?
oksian1 [797]
The answer to the question is "alpha testing". Alpha testing aims to address issues like errors and debugging before software is launched. This testing is performed by developers when problems arise. In the software testing process, alpha testing occurs first, followed by beta testing. During alpha testing, developers check existing modules or functions that may have malfunctioned, ensuring any detected errors are addressed.
6 0
20 days ago
CodeLab Question
Rzqust [894]

Response:

I am not familiar with coding languages, but I can demonstrate how you might do it in Python

myAlarm():

   arm = True

   code = "secret message"

myAlarm()

main():

deactivate = input(">>> ")

if deactivate = myAlarm.code:

  arm = False

I still feel a bit unclear about the question.

(I work as a game developer and code daily)

3 0
10 days ago
A regional trucking company landed a contract to supply products for a major retailer. To do this, it needs to hire an IT profes
zubka84 [942]
I believe the answers are F and A
.
8 0
13 days ago
Other questions:
  • Light travels at 3 × 108 meters per second. A light-year is the distance a light beam travels in one year.Write a PYTHON program
    14·1 answer
  • Some early computers protected the operating system by placing it in a memory partition that could not be modified by either the
    5·1 answer
  • List at least six things you would check for if you were asked to evaluate the workspace of an employee for ergonomics
    10·1 answer
  • Initialize the list short_names with strings 'Gus', 'Bob', and 'Zoe'. Sample output for the givenprogram:Gus Bob Zoeshort_names
    13·1 answer
  • A company requires an Ethernet connection from the north end of its office building to the south end. The distance between conne
    8·1 answer
  • Discussion Question 10: A bank in California has 13 branches spread throughout northern California , each with its own minicompu
    13·1 answer
  • (Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20
    11·1 answer
  • One form of Intrusion Detection System (IDS) starts operation by generating an alert for every action. Over time, the administra
    5·1 answer
  • Which of the following is NOT true about data?
    8·2 answers
  • What problem does the DNS solve? How does the DNS help the world wide web scale so that billions of users can access billions of
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!