Search
 
SCRIPT & CODE EXAMPLE
 

C

goto statement in c

#include <stdio.h>

// The goto statement is known as jump statement in C.
// goto is used to transfer the program control to a predefined label.
// Try to avoid it because it as much as possible because it's used to alter-
// -the sequence of normal sequential execution and making a small mistake
// lead to endless iterations.

int main()
{
	int i = 0;
    repeat_from_here:		// the label ( destination )
    	printf("%d ",i++);
    if( i <= 10 )				// Until the condition is satisified
    	goto repeat_from_here;	// the control will jump to the label ( source )
	return 0;
}
Comment

C Syntax of goto Statement

goto label;
... .. ...
... .. ...
label: 
statement;
Comment

PREVIOUS NEXT
Code Example
C :: getchar declaration in c 
C :: linear and binary search 
C :: bitwise operators 
C :: what is clrsce in C 
C :: deleting a word with copy fuction c code 
C :: linux_reboot_magic2 
C :: C Syntax of return statement 
C :: arduino internal pull up resistor 
C :: do a barrel roll 
C :: ouverture du fichier c 
C :: Multiplying a u64 to u128 in Rust 
C :: convert c code to assembly language 
C :: check if a number is even and bigger than or equal to 16 using bitwise 
C :: solidity signature r s v 
C :: code wars responsable drinker 
C :: Print Characters 
C :: reading arrays from stdin c 
C :: c programming print pattern pyramid 
C :: transform yt video into background overlay 
C :: c program for airthmetic operators 
C :: WAP to create Database using array of structure & display it in C 
C :: wpdb add temporary while drop table 
C :: cannot reach esp8266 via udp while he is running with a static ip 
C :: payement des véhicules a la sortie de station de langue c 
C :: reverse number in c 
C :: print binary c 
C :: recursion c prime number 
Dart :: flutter rounded bottom sheet 
Dart :: flutter listtile padding 
Dart :: how to change color in container flutter 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =