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
You are implementing a RAID storage system and have found a system with eight 100 GB drives. How much storage space will you hav
asambeis [7]

Answer:

The space available will vary between 800 GB (100%) and 400 GB (50%) of the total disks, depending on the RAID level.

The OS will handle the RAID as a single disk.

Explanation:

Each RAID level implements parity and redundancy in a different way, so the amount of disks used for this extra information will reduce the space available for actual storage.

Usual RAID levels are:

<u>RAID 0:</u> does not implement any redundancy or parity, so you will have available 100% of the total storage: 8 x 100 GB = 800 GB

<u>RAID 1:</u> Duplicates all the information in one disk to a second disk. Space is reduced in half: 400 GB

<u>RAID 5:</u> Uses the equivalent of 1 disk of parity data distributed evenly on each disk, meaning the space available is \frac{n-1}{n} of the total disks: \frac{7}{8} of 800 GB = 700 GB

Writting and reading the information on a RAID storage is handled by a raid controller, either implemented in hardware or software. The OS will "see" a single disk and will read or write information as usual.

4 0
3 years ago
Which technology can be used as a defense against dos and ddos syn flood attacks?
Montano1993 [528]
In terms of websites, there's a service called cloud flare which can prevent DDOS attacks in websites. Other applications you would have to look up. Hopefully this helps!
6 0
3 years ago
The file command provides information about any file system object (i.e., file, directory or link) that is provided to it as an
NeTakaya

Answer:

The answer is "Option a, c, and d".

Explanation:

This command aims to define the argumentation from each entity of the file system like a disc, path, or link. It checks the usage of a measurement system, which is requested to collect the information from either the inode of the item, the description of the option as follows:

  • In option a, It is used to identify the file type.
  • In option c, This command is used to list all file types.
  • In option d, This command is used to list all the current directories.
  • In option b, It is used to describe a single entity directory.
7 0
3 years ago
How does the Pareto principle apply to product development?.
Dominik [7]
The Pareto Principle, commonly referred to as the 80/20 rule, states that 80% of the effect comes from 20% of causes. Or, in terms of work and time management, 20% of your efforts will account for 80% of your results.
5 0
2 years ago
Which type of computer graphic can be resized without affecting image quality or getting distorted?
BartSMP [9]
Vector graphics can be rescaled without losing quality and each property can be changed like the colour, shape and size. 

Even if an object in a vector large, it doesn't need a lot of memory. Hence, the file size of a vector graphic is often very small.


8 0
3 years ago
Other questions:
  • ​You work at a call center of a large bank where you answer credit card services related questions from customers. Lately, you h
    14·1 answer
  • How to find i with superposition method
    8·1 answer
  • ________ gives its approval to U.S. e-commerce websites that follow strict privacy standards, such as explaining to visitors how
    6·1 answer
  • Explain and give examples of at least two search engines.
    9·1 answer
  • A(n ____ is anything about which data are to be collected and stored.
    8·1 answer
  • Dzięńdobry kto ogarnia komędy w minicraft bardzo dobrze i by mi pomógł w stworzeniu serwera [dostanie w zamian range właścieciel
    5·1 answer
  • 120
    14·1 answer
  • Complete the implementation of the following methods:__init__hasNext()next()getFirstToken()getNextToken()nextChar()skipWhiteSpac
    11·1 answer
  • What is the gear ratio?
    12·1 answer
  • Complete the function to return the factorial of the parameter using recursion,
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!