Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 614 Bytes

File metadata and controls

18 lines (13 loc) · 614 Bytes

Go to statement in C?

In C programming, "goto" is a keyword used for unconditional branching to a labeled statement in the same function. It allows you to jump to a specific labeled statement in the code without executing the statements in between. Here is an example:

       #include <stdio.h>

                  int main() {
            int i = 0;

            loop:
            printf("i = %d\n", i);
            i++;
            if (i < 5) {
                goto loop; // unconditional jump to label "loop"
            }

             return 0;
          }