DO NOT MISS

Ads

Monday 8 August 2016

C-Programs Using goto statement


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.


syntax :-
goto labelname;

There are two types of goto statements.
Those are
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:-


__________________________________________________
>> Back to Jumping Statements
___________________________________________________
___________________________________________________
_____________________________________________________
___________________________________________________

Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims