goto statement in C

goto articulation in C

By utilizing goto articulation you can move the control of program anyplace. This watchword isn’t prescribed to use in any circumstance.

Sentence structure

goto name;

. . . .

. . . .

name: explanation;

Why you ought to stay away from goto explanation in C?

It assumes the responsibility for the program anyplace and whenever which isn’t useful for programming advancement life cycle.

In this cycle, a program needs to investigate and re-test a ton of times.

Also, with the utilization of goto catchphrase, it makes extremely difficult to troubleshoot the program.

Let’s make one program to get it.

#include<stdio.h>
 
void main()
{
 int i=1;
 
 if(i==1)
  goto one;
 else if(i==2)
  printf("2");
 else
  printf("Its nothing");
 
 one:
 printf("Avoid goto keyword");
}

Output

Avoid goto keyword

This watchword is commonly used to take the control outside the circle. That is it. Else you ought to keep away from this catchphrase.

DURGESH

I Love python, so I like machine learning a Lot and on the other hand, I like building apps and fun games I post blogs on my website for Tech enthusiast to learn and Share Information With The World.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 + 9 =

Recent Content