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
malfutka [58]
3 years ago
11

11.

Computers and Technology
1 answer:
kodGreya [7K]3 years ago
6 0

Answer:

The basic difference between finite and infinite is the number of times it runs and ends. The loop is basically a set of instructions that keeps repeating itself.

The finite loop ends after running for a finite times. This body of finite loop will stop executing after certain condition is reached. Hence the finite loop body keeps executing itself finite number of times.

An infinite loop keeps running and repeating itself endlessly.This loop never ends. This loop can be the result of an error in a program. For example when no stopping or exit condition is specified in the program.

Explanation:

Example of finite loop:

Lets take for loop as an example:

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

{ cout<<i<<endl; }

Now the loop starts from i=0

Next it enters the body of loop to execute the statement: cout<<i; which means that the value of i is displayed on the output screen.

This loop keeps executing until the value of i exceeds 5.

At first iteration 0 is printed on the output screen, at second iteration 1, at third iteration 2, at fourth iteration 3, fifth iteration 4, sixth iteration 5. After each of these iterations, the value of i is incremented by 1.

When 5 is printed, then at the next iteration the specified condition i.e. i<=5 gets false as the value of i now becomes 6 after incremented by 1.

So the loop stops running. So this means that loop ran for finite times and stopped after the a certain condition is reached. The output is:

0

1

2

3

4

5

Example of infinite loop:

Lets take while loop:

int i = 6;

    while (i >=5)

    {         cout<< i;

             i++;     }

In the above example, the loop will run infinite times. Here the value of i is initialized to 6. Then while loop is used which checks the condition which is the value of i is greater than or equal to 5. If the condition is true, the body of the loop starts executing which prints the value of i. Lets see what happens at each iteration:

1st iteration: i>=5 is True because i=6 and 6 is greater than 5. The program control enters the body of loop. The statement cout<<i prints 6. Next the value of i is incremented by 1 and it becomes 7.

2nd iteration: i>=5 is True because i=7 and 7 is greater than 5. The program control enters the body of loop. The statement cout<<i prints 7. Next the value of i is incremented by 1 and it becomes 8.

This loop will repeat itself infinite times and never stops as i will always have value greater than 5. So this is the example of infinite loop.

You might be interested in
All of the following are eras in IT infrastructure evolution except the​ ________. A. general purpose mainframe and​ mini-comput
Digiron [165]

Answer:

C: disruptive technology era

Explanation:

There are five main stages in IT infrastructure era and the are, in order from the oldest to the newest; the mainframe and minicomputer era, the personal computer era, the client/server era, the enterprise era, and the cloud computing being the newest in the five stages eras of IT infrastructure.

7 0
3 years ago
The rubric given to them by their teacher requires that
Arte-miy333 [17]

Answer:1:navigate to the paragraph command group

2:Click the line and paragraph spacing option

3:Click the space required

Explanation:

3 0
3 years ago
Which type of software is created on user dimension​
Ratling [72]

Answer:

Application and system software is created on user dimension.

6 0
2 years ago
Your internet is out, and devices connected by WiFi and ethernet will not connect. You check several websites, and all your pack
tiny-mole [99]

Answer:

a) Open the DNS settings on your router and try using a different DNS.

Explanation:

The DNS or domain name service is a protocol that majorly assigns a URL string to an IP address. This is because the IP address as a number is easily forgotten.

In the question above, the operator could not access the websites with the URL name but can confirm connectivity to the site with its IP address. This means that the IP address can be used to access the websites directly, so, the DNS protocol is either not configured or is down.

6 0
2 years ago
If you got band from a local library, what would be the reason for it besides shouting and talking? You're answer has to fit you
VLD [36.1K]

Answer:

I would get a band from the library because I check out ten books and returned them in a week. I also would just be in the library all the time and they would get frustrated. That or I would spend hours talking to a librarian about my favorite books and they would get fed up with me.

4 0
3 years ago
Read 2 more answers
Other questions:
  • which of these paste options is commonly available from the paste options button? A&gt; use the destination them. B. keep the em
    14·2 answers
  • Mention<br>any<br>5<br>indicators of<br>happiness​
    11·2 answers
  • What is a characteristic ofa good cloud-based hosting?
    5·1 answer
  • What does a page break do?
    13·1 answer
  • Discuss what repetitions structures are, and how they differ from the vectorization approaches we have previously studied in the
    10·1 answer
  • Which of the following are ways that
    9·1 answer
  • What is gained by increasing the ritation speed of a disk or cd?​
    9·1 answer
  • PLEASE ANSWER FAST.one of the barriers for early "talkies" was the need to manually crank the projector and manually synchronize
    13·1 answer
  • Tabs are usually set ________ to the right of the left margin.
    10·2 answers
  • From which country samsung is​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!