The goto statement is used to sends the control from one place to another place.
(or)
It is one of the fundamental function using this function, we can perform input,output operations in a specified location of the screen.
goto labelname;
Those are
1. Forward goto
2. Backword goto
1. Forward goto
2. Backword goto
Syntax of forward goto:-
goto labelname; -----
-----
labelname:
-----
-----
Syntax of backword goto:-
labelname: ------
------
goto labelname;
------
------
* Write a program to use goto statement.
#include<stdio.h> #include<conio.h> void main() { int number; clrscr(); printf(“Prasad\n”); goto x; y: printf(“Vineela\n”); goto z; x: printf(“Lakshmi\n”); goto y; z: printf(“Sanker\n”); getch(); } |
Output:-
__________________________________________________
___________________________________________________
_____________________________________________________
___________________________________________________
Post a Comment