Programming Constructs

All programming languages utilise program constructs. They are used to control the order in which statements are executed. There are a number of programming constructs. The sequential statement does not contain any test condition. It refers to a series of statements that are performed in sequential order. Control statements control the flow of the program execution either by repeating or skipping the set of statements based on the result of the test condition. A selection statement is a control statement that allows choosing between two or more execution paths in a program. A Selection statement is a control statement that executes according to the result of the test condition.

In the switch statement the value of the expression is compared with each of the values in the case statements. Once the value of the expression matches any case value then the sequence of statements following that case value is executed. Iteration or looping allows a certain set of instructions to be performed repeatedly until a certain condition is fulfilled. Various types of looping statements are for loop, while loop and do while loop. A for loop is a repetition control structure that allows user to efficiently write a loop that needs to execute a specific number of times. A while loop is a control structure that allows user to repeat a task a certain number of times. Each time the body of a loop is executed, a pass is made through the loop. This pass is called an iteration.

To Access the full content, Please Purchase

  • Q1

    What is another name for iteration construct?

    Marks:1
    Answer:

    The iteration construct is also called looping construct.

    View Answer
  • Q2

    What is the function of a jump statement?

    Marks:1
    Answer:

    It is used to transfer control of a program from one location to another within a function.

    View Answer
  • Q3

    What do you understand by selection construct?

    Marks:1
    Answer:

    Selection construct means the execution of statements depends upon the condition test.

    View Answer
  • Q4

    What do you mean by sequence construct?

    Marks:1
    Answer:

    Sequence construct means the statements are executed sequentially till the end of the program.

    View Answer
  • Q5

    Define the term “body of the loop”.

    Marks:1
    Answer:

    A set of statements which is executed repeatedly, is called the body of the loop.

    View Answer