“GOTO -Aussage in C.” Code-Antworten

GOTO -Aussage 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;
}
Sam the WatchDogs

C Syntax der GOTO -Erklärung

goto label;
... .. ...
... .. ...
label: 
statement;
SAMER SAEID

Ähnliche Antworten wie “GOTO -Aussage in C.”

Fragen ähnlich wie “GOTO -Aussage in C.”

Weitere verwandte Antworten zu “GOTO -Aussage in C.” auf C

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen