Home

A program to explain GOTO

C Programming Language 048

The following code shows how to write a program to explain GOTO.

Program

#include <stdio.h>

void main()
{
    printf("Hi\n");
    printf("Good morning\n");

    goto abc;
    printf("Have a nice day\n");

abc:
    printf("End\n");
}

Result

Hi
Good morning
End


Last Updated on

Next Post: Rules vs Guidelines →

Comments