TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Sunday, 10 May 2020

Goto Statement In C Language | Goto Statement In C Language In Hindi

Goto Statement In C Language

The goto statement is rarely used because it makes program confusing, less readable and complex.
When a goto statement is encountered in a C program, the control jumps directly to the label mentioned in the goto statement.

Syntax of goto statement in C


goto label_name;
:  :
:  :
label_name: c statement

download image of goto statement in c

Fig: Goto statement in c 

Program

#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0;
for(int i=0;i<=10;i++)
{
sum=sum+i;
if(i==5)
{
goto addition;
}
}
addition:
printf(“%d”, sum);
getch();
}

Output:

15

No comments:

Post a Comment