34-Write a C program to show the functionality of goto function

Program: 34

Write a C program to show the functionality of goto function.

#include
#include
void main()
{
    int rs;
    printf("How much money do you have in your pocket: ");
    scanf("%d", &rs);
    if(rs>=600)
        goto delhi;
    else
    {
        printf("Go to SRS");
    }
    delhi:
        printf("Go to Delhi");
        getch();
}
Output
How much money do you have in your pocket: 3234

Go to Delhi

 

 

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.