Unconditional Control Transfer Statements in C

Unconditional Control Transfer Statements is used to transfers the control to some other place in the program. In C Programming Language, There are four types of unconditional control transfer statements.

    1. goto
    2. break
    3. continue
    4. return

goto statement:

The goto statement is used to transfer the control from one part of the program to another. It has the following syntax :

- - - - - - - - - - -
goto display;
- - - - - - - - - - -
- - - - - - - - - - -
display;
- - - - - - - - - - -

when this statement is executed, the control is transferred to the statement lebel display which is followed by a colon.

break statement:

The break statement is used to transfer the control to the end of a statement block in a loop. It is an unavoidable statement to transfer the control to the end of a switch statement after executing anyone statement block. It has the following syntax :
break;

continue statement:

The continue statement is used to transfer the control to the beginning of a statement block in a loop. It has the following syntax:
continue;

return statement:

The return statement terminates the execution of a function, it returns control to the calling function. It resumes the execution in the calling function immediately.
It has the following syntax:

jump instruction or statement:
return expression;

Recommended Posts:

C
    1. Fundamental of C Language
    2. Data Types in C
    3. Operators in C
    4. Type Conversion in C
    5. Console Input Output Functions in C
    6. C Program to Swap Two Numbers With or Without Temporary Variables
    7. Control Statements in C – if, else, switch
    8. Loop Control Statements in C | for, while, do-while loop
    9. Unconditional Control Transfer Statements in C
    10. C Program to Check Armstrong Number
    11. C Program to Generate Fibonacci Series
    12. C Program to Check Whether a Number is Prime or Not
    13. C Program to Convert Binary Number to Decimal
    14. C Program to Convert Decimal Number to Binary