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
Why is a monitor an output device?
denis23 [38]
Because it's getting info from the computer and presenting it to you. Similar in principle to a printer.
6 0
3 years ago
Which of the following Access objects provides a user-friendly data entry method?
Rina8888 [55]

Answer:

Table

Explanation:

Microsoft Access uses an object called a _____ to enter and organize data.

The answer is table.

6 0
2 years ago
With which type of social engineering attack are users asked to respond to an email or are directed to a website where they are
kirza4 [7]

Answer:

Phishing

Explanation:

Phishing is a social engineering attack where users are asked to respond to an email or are directed to a website where they are requested to login with their personal credentials, such as passwords or credit card numbers.

How Phishing Works?

The attacker first carefully designs a web page identical to a real bank with fine details. Then attacker persuades the victim to go to this fake web page with login screen. The attacker gets all the information typed and enter into that fake web page. The victim often thinks that this is exactly my bank's web page so nothing is going to happen if I put log in credentials.

How to avoid Phishing?

This kind of attack can always be spotted with one simple trick. Check the address of the web page carefully. The attacker can design the web page according to his wish but he cannot have control over the web address of a real bank or real a website.  

Some general safety tips are:

  • Don't open links from spam emails.
  • Don't download malicious software.
  • Don't share personal information with strangers
7 0
3 years ago
What part of the code is a signal for the function to execute and pass back a value?
Trava [24]

Answer:

2

Explanation:

6 0
3 years ago
Read 2 more answers
An air-conditioning system's automatic controller might directly control the
yaroslaw [1]
Control the temperature of the system and as well as how long the system will run
5 0
3 years ago
Read 2 more answers
Other questions:
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • What bus carries a status signal back to the CPU?
    14·1 answer
  • What is the importance of Mathematical Modeling in the field of bioinformatics.
    8·1 answer
  • How is the cia triad used to evaluate encryption methods?
    6·1 answer
  • Which type of graph or chart measures
    15·2 answers
  • Types of data processing
    5·1 answer
  • Assume that class BankAccount exists, and that it has a constructor that sets the private field balance, and that setBalance and
    13·1 answer
  • Which feature of REPL.it would you use to transmit your program to a friend?
    12·1 answer
  • Difference between hacking and cracking not hackers and crackers ​
    10·1 answer
  • Which of the examples is part client side code
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!