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
1) Which forms are NOT appropriate to use for affirmations in Full Verbatim?
Oliga [24]

NOT appropriate to use for affirmations in Full Verbatim are :

d) Mm

e) Ammm

f) Aha

Explanation:

  • In verbatim transcription, interviews are transcribed word for word, and sound for sound.  Every um, uh, laugh, and sound must be recorded for posterity.

These are the preferred spellings of typical utterances:

  1. Affirmative: uh-huh, mm-hmm, yeah.
  2. Don't use: um-hum, um-hmm, uh-hum

  • Full verbatim refers to a transcript that includes absolutely everything that is said, exactly how the speakers say it. This means we include all ums, uhs, grammatical and vocabulary mistakes, false starts and repetitions - everything.
  • Verbatim is defined as an exact repetition without changing the words. An example of verbatim is when you quote someone exactly without changing anything.
3 0
3 years ago
Hi Lesiana, After your presentation last week, the manager thinks an in-house solution is the way to go. Although our programmer
zlopas [31]

The Hierarchical drawing of the In- House solutions includes Four categories such as product, service, training, support and about.

<h3>What is Hierarchical drawing?</h3>

Hierarchical drawing is also known as Layered Graph Drawing which includes the drawing in the vertices and are made on the Horizontal rows and layers.

The complete solution is attached below.

The In-House solutions' hierarchical diagram covers four categories, including product, service, training, support, and about.

Learn more about Hierarchical drawing here:

brainly.com/question/26031625

#SPJ1

 

3 0
2 years ago
Nanotechnology is a scientific area that deals with making or changing things that are incredibly _______________.
Dima020 [189]

Answer:

small

Explanation:

Nanotechnology deals with incredibly small things on the nanoscale.

3 0
3 years ago
Advantages and disadvantages of screen reading​
STatiana [176]
It can make ur eyes blind blind that’s a disadvantage
7 0
3 years ago
Read 2 more answers
my pc wants to run the highest graphics even though I restart it everyday and it gets around 10 fps and I have a 1080 Nvidia gra
Luden [163]

Answer:

you have to restart the rom , if that doesnt work , start the ram

Explanation:

5 0
3 years ago
Other questions:
  • 1. The graphical representation of the users character of alter ego is their:
    11·1 answer
  • Which of the following groups would an animal with an exoskeleton, segmented body, and jointed appendages belong to???
    14·2 answers
  • To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then pr
    7·1 answer
  • You are adding a new 500 GB hard drive to your computer. The hard drive must be formatted with a file system to organize files i
    8·1 answer
  • Air circulation is caused by ... A Earth's rotation around the sun B winds that move vertically C moving air between hot and col
    11·1 answer
  • Which amendment to the Constitution ended slavery in the United States?
    8·1 answer
  • In computer science how can you define "copyright, designs and patents act 1988"?​
    8·1 answer
  • Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of
    8·1 answer
  • Consider the following declaration:
    9·1 answer
  • Write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. Your program should print each nu
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!