Computer scienceAlgorithms and Data StructuresIntro to algorithms and data structuresPseudocode and representation

Flowcharts

No infinite loops

Report a typo

Remember the infinite loop in the flowchart from the theory? Usually, such problems are a result of a badly formulated task. So, let's correct the description of the following task:

We need an algorithm that is supposed to ask for the variable i and loop until i becomes equal to 20 for inputs less than 20. The other numbers are just printed as they are. Below is the flowchart with an infinite loop from the theory:

Loop in the flowchart

Imagine you are assigned to fix this bug. What would be the corrected version of the flowchart that solves the task correctly and has no loops that run forever? Select all the correct options.

Three flowcharts

Select one or more options from the list
___

Create a free account to access the full topic