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
Alona [7]
3 years ago
3

It is placed within the code of a loop to cause the program to stop the loop statement.

Computers and Technology
1 answer:
Kisachek [45]3 years ago
7 0

Answer:

break

Explanation:

The loop is used in the program for executing the block of statement again and again until the condition is not false.

let discuss the options:

a. else

it is a condition statement and it is used with if statement. it is not used for stopping the loop.

c. continue

this statement is used to skip some part of the statement and then continue the loop.

for example:

for(int i=0;i<5;i++){

i++;

continue;

cout<<"continue:";

}

when the above code executes, the program does not print the message "continue" because when the program gets the continue statement it controls to go back to the for loop statement again it skips all the below of continue statement under the loop.

So, it is not used as stopping the loop.

d. goto....label:

it is used to move the control of the program to the different location as shown by label but is not stop the loop statement.

the last option: break, it is the one which is used to break the statement.

when program execution found the statement break, the program breaks the loop statement and starts executing the next statement.

Therefore, the answer is a break.

You might be interested in
What are the benefits of writing functions that use parameters and return List 2 please and explain what is return
Ratling [72]

<u>Answer and explanation:</u>

There are many benefits of writing functions that use parameters and return. Some of them are:

1. Flexibility: With functions having parameters, several values of the parameters can be used at invocation time thereby making the application flexible. For example, given the following function in Java.

<em>public void showName(String name){</em>

<em>    System.out.println("Your name is " + name);</em>

<em>}</em>

To call this method (function), the programmer could use various values for the name parameter used in the function like so:

showName("John");

showName("Doe");

If the function didn't have a parameter, it is possible it will only print a hardcoded name every time the function is called.

2. Scope Control: When a function is allowed to return a value, it helps to work around scope issues since variables declared within a function are limited to that function and do not exist outside the function. This means that the values of these variables cannot be used anywhere else outside the function in which they are being declared. However, if the function returns a value, the value can be used anywhere else in the program.

For example:

<em>public String getDouble(int x){</em>

<em>    int y = x * 2</em>

<em>    return y;</em>

<em>}</em>

The function above returns twice the value of the argument supplied to it. Since the integer variable y is declared within the function, it's value cannot be used outside the function. However, since the value is being returned by the function, it could be used anywhere the function is being called. Thanks to the return keyword.

3 0
3 years ago
The 3 parts of the CPU are
katrin2010 [14]

Central Processing Unit

Arithmitic Logic Unit

Control Unit


3 0
4 years ago
Read 2 more answers
As a result of the Internet, people today
Nimfa-mama [501]

Answer:

hi there, the answer is

a. use more mobile devices

hope this helps :)

have a good day!

Explanation:

i just took the quiz rnnn

3 0
3 years ago
Read 2 more answers
You have an interface on a router with the ip address in the class c network subnet of 192.168.192.10/29. how many total host ad
Gemiola [76]
If 29 bits of the 32 available addressing bits are used for the subnet, then only 3 bits giving 2^3=8 combinations remain for the host addresses. 

In reality, the all zeros and all ones addresses are reserved. So, 8 addresses can exist, but 6 of those are available.

The way the question is formulated it seems the answer 8 is what they're after.
8 0
4 years ago
You are an interior decorator, confronted with a dark living room. To lighten the room up, you have n candles and want to build
user100 [1]

Answer:

a)

Algorithm to find a solution of min. cost

Function:cost(Graph G,Graph G1);

GC --> empty graph

for i in edges E:

if E(i,j) in G:

c(i,j)=c(i,j)

else if E(i,j) in G1:

c(i,j)=-c(i,j)

Function:Mincost(Graph G):

GC=Cost(G,G1)

while(negativecycle(GC)):

Update residal graph(G1)

GC=Cost(G,G1)

mincost=sum of Cij*F(i,j)

return mincost;

Explanation:

a)

1) Start the program

2) Read the no. of edges and vertices and also read the cost of the two nodes.

3) Find the min cost by travelling to the destination i.e.. finding all possible min. cost values.

4) Compare the all possible min.cost values

5) And display the least min. cost

6) Stop the program

b)

<u>Correctness of algorithm</u>

1)Here in these algorithm we are calculating all the possible cases.

2)These algorithm also supports the negative cost.

3)These algorithm occupies more space.

4)Takes less time

5)so,these algorithm provides the cost efficient solution very effectively.

c)

<u>Run Time Analysis</u>

1) While reading the values during the run time the program execution will stop until user provides the values.

2) Based on the User input Output vary.

3) Time consumption and space consumption is depends on the no. of inputs the user is given.

6 0
4 years ago
Other questions:
  • Which statement is true about customizing presentation programs?
    6·1 answer
  • Deterime the minimum number of multiplication operations needed to compute the following. Show the order of the computations.
    10·1 answer
  • for which is a chart legend used? a.all of the time b.whenever you are comparing data that is the same c.whenever you are compar
    9·2 answers
  • Use the following data definitions data myBytes BYTE 10h,20h,30h,40h myWords WORD 3 DUP(?),2000h myString BYTE "ABCDE" What will
    9·1 answer
  • Stuck on where to go with this one.
    15·1 answer
  • Which of the following is the largest unit of information?
    15·2 answers
  • Cell references in a formula are called _____.<br> a. assumptionsc. numbersb. valuesd. content
    11·1 answer
  • Why do you think there is a difference between good, clean designs compared to the bad, cluttered designs below?.
    6·1 answer
  • How can you relate the careers in Finance as BSIS students?
    15·1 answer
  • 4. Return the card number, first name, last name, and average late fee of each customer. Name this column as "Fee".
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!