Write a program to print the name of the day using the switch statement.

Written by Sharad Raj on 13th of March, 2018

BASIC PROGRAMS   C LANGUAGE PROGRAMS

PROGRAM CODE

#include<stdio.h>

#include<conio.h>

void main()

{
int day;

clrscr();

printf(“Enter the number of day : “);

scanf(“%d”,&day);

switch (day)

{

case 1:

{

printf(“SUNDAY”);

break;

}

case 2:

{

printf(“MONDAY”);

break;

}

 

case 3:

{

printf(“TUESDAY”);

break;

}

case 4:

{

printf(“WEDNESDAY”);

break;

}

case 5:

{

printf(“THURSDAY”);

break;

}

case 6:

{

printf(“FRIDAY”);

break;

}

case 7:

{

printf(“SATURDAY”);

break;

}

 

default:

{

printf(“Wrong choice.”);

}

getch();

}