“pernyataan goto di c” Kode Jawaban

pernyataan goto di 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

S Sintaks dari pernyataan GOTO

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

Jawaban yang mirip dengan “pernyataan goto di c”

Pertanyaan yang mirip dengan “pernyataan goto di c”

Lebih banyak jawaban terkait untuk “pernyataan goto di c” di C

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya