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
prohojiy [21]
3 years ago
10

What is the output of this program?

Computers and Technology
2 answers:
cupoosta [38]3 years ago
4 0

Answer:

The output is 20

Explanation:

Given:

<em>numA = 2 </em>

<em>for count in range(5,8): </em>

<em>     numA = numA + count </em>

<em>print(numA)</em>

<em />

Required:

Determine the output

The first line of the program initializes numA to 2.

The next iteration sum up integers from 5 to 7 (i.e. 8 - 1) to the initialized value of numA

So, numA becomes

numA = 2 + 5 + 6 + 7

numA = 20

Hence, the output is 20

Charra [1.4K]3 years ago
3 0

Answer:

20

Explanation:

assuming the print statement is not indented, the program effectively calculates 2+5+6+7.

The range(...) is <em>excluding </em>the end value (8 in this case).

You might be interested in
Hello, please help write code in C++. Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go nort
krok68 [10]

Answer:

Please Find attached  c++ code file.

Explanation:

  1. Ask User to enter highway number.
  2. Check if highway is primary or auxiliary.
  3. Check if highway number is even / odd.
  4. Find Primary high number for an auxiliary highway

Check if highway is primary or auxiliary.

Use if condition to check if the entered number is in between 0 and 99.If it's true than the highway is primary otherwise it's an auxiliary highway.

Check if highway number is even / odd.

To check if a number is even or odd we use simple modulo formula. In mathematics modulo returns the reminder of a division operation on two numbers.If modulo of a number and 2 is equal to zero than that number is an even number other wise its an odd number.

(Any number ) mod 2 = 0

Find Primary high number for an auxiliary highway

As mentioned in the question last two digits of highway number is the number of primary high.

To Find last two digits of number apply modulo operation on highway number and 100. it will provide last two digits of number specifying our primary highway.

Download cpp
3 0
4 years ago
You are embedding a video in your Webpage. What three formats should you specify in the source
Bogdan [553]

Answer:

d

Explanation:

3 0
3 years ago
Marisa wants to customize her computer's default firmware. ROM allows data to be changed or modified when necessary.
ludmilkaskok [199]

Answer: ROM stands for "Read-only memory", this is permanent, so false.

4 0
2 years ago
Read 2 more answers
1. The goals of the Safety Office of the Department of Transportation include______.
Lesechka [4]
The correct answer is D
5 0
3 years ago
write a while loop that reads integers from input and calculates integer finalnum as follows: if the input is divisible by 5, ad
ira [324]

The while loop for the program that reads integers from input and calculates integer is illustrated thus:

#include <iostream>

using namespace std;

int main()

{

//declaring the variables

int userInput;

int outputVal;

outputVal = -19;

//take user input

cin >> userInput;

//take user input until negative input is given

while(userInput > 0)

{

 //if the input is divisible by 5, subtract the

 //input divided by 5 from outputVal

 if(userInput%5==0)

     outputVal -= userInput/5;  

 //if the input is not divisible by 5, add the

 //input multiplied by 5 from outputVal

  else

     outputVal += userInput*5;

   cin >> userInput; // take input

}

//print the output value

  cout << "Output value is " << outputVal << endl;

return 0;

<h3>What is a while loop?</h3>

A while loop is a control flow statement in most computer programming languages that allows code to be performed repeatedly based on a supplied Boolean condition. The while loop is similar to a looping if statement.

A "While" Loop is used to iterate over a certain block of code until a condition is met. If we wish to ask a user for a number between 1 and 10, we don't know how many times the user may enter a larger number, so we keep asking "while the number is not between 1 and 10."

Learn more about program on:

brainly.com/question/22654163

#SPJ1

7 0
1 year ago
Other questions:
  • When programming, the word "execute" means which of these?
    13·1 answer
  • In a PowerPoint presentation, it is not possible to add notes that are hidden from the audience's view.
    9·1 answer
  • Which is an example of an active visual interface? a display indicating the amount of ammunition for the currently equipped weap
    13·2 answers
  • Read the Security Guide about From Anthem to Anathema on pages 238-239 of the textbook. Then answer the following questions in t
    14·1 answer
  • Which phrases/sentence correctly describe the use of bitmap images?
    8·1 answer
  • For each of the following polynomials, apply either the Muller's method or the Bairstow's method to find all real or complex roo
    15·1 answer
  • Based on the following quote from Leonardo Da Vinci, what would be his definition of a fine artist? “Principles for the Developm
    11·2 answers
  • Which statement describes a biotic factor interacting with the environment?
    5·1 answer
  • What is the difference between spyware and adware?
    8·2 answers
  • What are the different types of topology?​ in details
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!