Anonymous

What Are The Three Basic Control Structures?

4

4 Answers

Abadit Ali Profile
Abadit Ali answered
In programming normally the sequence of instruction is no limited to linear. We need to repeat several statements or we need to jump from one part of the program to another part of the program. For this purpose the control structures are used.

The following are the types of control structures.

Conditional structure:
If and Else statement is used in the programming for conditional structures. This statement uses a specific condition check. If this condition is true the code following the If statement will be executed otherwise the Else portion will be executed. The Else part of the If state is optional. The syntax of this condition structure varies language to language.

Iteration structure:
Iteration structure or loops are used to repeat the instructions. There are mainly three types of loops available. For Loop, While Loop, do while loop. These loops repeat the instruction until a specific condition is true.

Jump statements:
These statements include Break, Continue and Goto instructions. These instruction jumps from one portion of the program to another portion of the program. The function calling can also be included in this category.

Selective structure:
Switch statement is called selective structure. In this we provide a number of options and take decision depending upon the choice.
Kainat hasan Profile
Kainat hasan answered
Beginning in the 1960s, a number of researchers began to store program design (planning) and the merits of separating the design process from the actual program coding. such a division of labor is a natural one, just as you have architects who designs buildings and separate construction crews who work from specification to erect them. Many of the proposed ideas of the researchers caught on, and methods have evolved that have made program design more systematic and the programs themselves easier to understand and maintain. These methods usually are grouped together under the term structured programming. Advocates of structured programming have shown that any program can be constructed out of three fundamental control structures; sequence, selection, and looping. A sequence control structure is simply a series of procedures that follow one another. A selection (if-then-else) control structure involves a choice. A loop is an operation that repeats until a certain condition is met. With DOWHILE, a loop is executed as long as a certain condition is true. With DOUNTIL, a loop continues as long as a certain condition is false. The three basic control structures are the major building blocks for structured program flowcharts and pseudo code. Control structure is a pattern for controlling the flow of logic is a computer program. The three control structured are: Looping, DOWHILE, DOUNTIL.
raaga Profile
raaga answered
In any programming language there are some control structures that are used to change the flow of control as required. Two most commonly used control structure are as:

1. iterative structures
2. conditional structures

Conditional structures consist of some condition statements (like if-else statement in C++). These statements check a condition, and perform an action (e.g., execute some statements or call a function etc.) in the case of true condition an in the case of false statement they perform something else as specified by the programmer.

Iterative structures are used to iterate one or more statements either for a specified number of times or until a specified condition if fulfilled.

the most commonly used iterative structures in C++ are for loop , while loop and do while loop. these may be semantically different in different languages but generally these are same in semantics.

for loop is normally called counter loop because it is used to iterate the control for a specified number of times and while loop is called conditional loop.
The third control structures are 'got' statement which neither checks a condition nor iterates statements.

The Goto statement when encounters, just transfer the control to the specified location.
This type of structures are not commonly used today because they don't provide some sense of programming.
Florio Potter Profile
Florio Potter answered

  • Sequential: Default mode. ...
  • Selection: Used for decisions, branching -- choosing between 2 or more alternative paths. ...
  • Repetition: Used for looping, i.e. Repeating a piece of code multiple times in a row.
For more information get help at

CodeAvail- Online Computer Science Assignment
help

Answer Question

Anonymous