Image

Programs - C Language - Goto, Break, Continue

Program:

#include <stdio.h>
#include <conio.h>
void main(){
int num;
printf("Enter value of num:");
scanf("%d",&num);
switch (num){
  case 1:
   printf("You entered value 1 ");
   break;
  case 2:
   printf("You entered value 2 ");
   break;
  case 3:
   printf("You entered value 3 ");
   break;
  default:
   printf("Input value is other than 1,2,3 ");
 }
 getch();
}