To print present lift position using switch case in c


This program is about find and print the present Elevator position using Swtich Case in C

Source Code

#include <stdio.h>
int main()
{
int a;
printf("Enter Floor No : ");
scanf("%d",&a);
switch(a)
{
case 1:
  printf("\nFirst Floor");
break;
case 2:
  printf("\nSecond Floor");
break;
case 3:
  printf("\nThird Floor");
break;
default:
  printf("Invalid No");
break;
}
return 0;
}
To download raw file Click Here

Output

Output:
Enter Floor No:3
Third Floor

List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C


Learn All in Tamil © Designed & Developed By Tutor Joes