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
Generally, websites ending in .edu, .gov, and .org are less likely to be biased, or to show preference toward a certain financia
svetlana [45]

Answer:

True

Explanation:

Domain extensions always appear at the end of a website's address.

It's a means to categorise websites.

.edu domains are used for educational purposes

.gov are restricted to by government entities

.org is largely used by nonprofit websites.

While

.net is derived from the word network, indicating it was originally intended for organizations involved in networking technologies, such as Internet service providers and other infrastructure companies

.biz is intended for registration of domains to be used by businesses

The right domain extension adds credibility and memorability to your website by aligning it with a specific brand purpose.

8 0
3 years ago
Name and describe each of the five parts of a standard wind tunnel.
Serjik [45]
Fan
drive motor
diffuser
contraction section
test section
3 0
2 years ago
Read 2 more answers
Which one of these components is a part of the central processing unit (cpu)of a computer
katovenus [111]

Answer:

Control Unit

Explanation:

4 0
3 years ago
There are many advantages and some disadvantages to using social media. Explain at least one of the advantages to
OverLord2011 [107]

Answer:  yes

Explanation:social media has the advantage of long distance communication and a disadvantage is cyber bullying and yes i thank if most people where nice long social media is good  

3 0
3 years ago
Case Project 13-3 A cloud customer has asked you to do a forensics analysis of data stored on a CSP’s server. The customer’s att
kkurt [141]

Answer:

idk

Explanation:

6 0
2 years ago
Other questions:
  • The ____ file permission category in unix/linux systems typically entails all permissions and is designated by the letter u.
    7·1 answer
  • Write a program that loops one thousand times. add all the even numbers and display the results. add all the odd numbers and dis
    13·1 answer
  • Wireless network devices use ________ to communicate with each other.
    9·2 answers
  • Why is charles babbage known as father of computer?​
    10·1 answer
  • What is the full form of ABC?
    9·2 answers
  • PLZ HELP ME ITS URGENT PlZ PLZ PLZ
    11·1 answer
  • How would you define media literacy?
    12·1 answer
  • PLEASE HELP WITH MY COMPUTER
    8·2 answers
  • WHY DO YOU DElete EVERY QUESTIONS THAT IS ASKED! Im a freaking guy, yes and i wont followers for my channel so leave me alone!
    7·2 answers
  • Write a program that uses a structure to store the following data about a customer account: Name Address City, State, and ZIP Te
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!