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
expeople1 [14]
3 years ago
5

How many times will line 7 be executed when the following code is run?

Computers and Technology
1 answer:
cluponka [151]3 years ago
8 0

Answer:

4 times

Explanation:

Required.

How many times will line 7 be executed?

Line 2 initialises i to 0

Line 3 subtracts 1 from the length of "rebellion" , the result of the subtraction is then saved in J

So:

j = 9 - 1

j = 8

From line 2 and line 3, we have that:

i = 0 and j = 8

Line 4 is an iteration that is repeated as long as i is less than j

Line 7 will be executed, for the first time as: i < j because 0 < 8

i is incremented to 1 and j is reduced to 7

Line 7 is then executed again, the second time because 1 < 7

i is incremented to 2 and j is reduced to 6

Line 7 is then executed again the third time because 2 < 6

i is incremented to 3 and j is reduced to 5

Line 7 is then executed again the fourth time because 3 < 5

i is incremented to 4 and j is reduced to 4

At this stage, line 7 will no longer be executed because I is no longer less than as 4 = 4.

Hence, number of execution is 4 times

You might be interested in
Digital rights include the right to
faltersainse [42]
D. Speak your ideas with respect on the internet .
7 0
2 years ago
A _____ describes two or more computers connected to each other.
Soloha48 [4]
I’m pretty sure it’s server
4 0
3 years ago
Read 2 more answers
What is the difference between a Is your Milling machine and grinding machine
Law Incorporation [45]

Answer:

one is used for milling and one is used for grinding

Explanation:

8 0
2 years ago
Guys Do you know about e-waste recycling well ?
TEA [102]
<span>E-waste is a popular name for elecronics at the end of their "useful life".. computers, tv, steros, copiers, and fax mations are some common products. many of them can be reused, refurbished, or recycled. 
</span>
4 0
3 years ago
Read 2 more answers
Viết chương trình hoàn chỉnh các yêu cầu sau:
Blababa [14]

Explanation:

the perimeter of an aluminium sheet is 120 CM if its length is reduced by 10% and its breadth is increased by 20% the perimeter does not change find the measure of the length and the breadth of the sheet

4 0
3 years ago
Other questions:
  • To play game, go inside the Grand Theft Auto V folder and right click and runGTAVLauncher as administrator.If you get any missin
    5·1 answer
  • The area of a rectangle is the rectangle's length times its width.
    5·1 answer
  • What are some benefits of 3-D printing?
    9·1 answer
  • Please help Ill give you brainliest if I get 2 answers. Which is used to input information on a laptop?
    6·1 answer
  • Two-dimensional random walk (20 points). A two-dimensional random walk simulates the behavior of a particle moving in a grid of
    14·1 answer
  • You are given an integer N, followed by N lines of input (1 &lt;= N &lt;= 100). Each line of input contains one or several words
    8·1 answer
  • Do word provides an undo button that can be used to cancel the most recent command or action
    13·1 answer
  • How do you use switch board in the office​
    6·1 answer
  • The software concept ___________and defines a need for the new system.
    6·1 answer
  • What is a closed system?​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!