"HARD WORK BEATS TALENT WHEN TALENT DOSEN'T WORK HARD."
"HARD WORK BEATS TALENT WHEN TALENT DOSEN'T WORK HARD."
goto is a keyword as well as jumping statement. goto is use to transfer the control or jump.
goto statement always required label.
abc: ← colun ↑ label_name with colun
1. backword declaration
label_name: - - - - - -- - - - goto label_name;
2. forward declaration
goto label_name; - - - - - -- - - - label_name:
#include<stdio.h> void main() { int a; clrscr(); raza: printf("You are not eligible for driving license."); printf("\nEnter Your Age:- "); scanf("%d",&a); if(a<18) { goto raza; } else { printf("Your are eligible for driving license."); } getch(); }
You are not eligible for driving license. Enter Your Age:- 12 You are not eligible for driving license. Enter Your Age:- 26 Your are eligible for driving license.