C program to input number of week's day(1-7) and translate to its equivalent name of the day of the week

#include<stdio.h>
#include<conio.h>

void main()
{
int ch;
clrscr(); //to clear the screen
printf(“Enter number of week’s day(1-7):”);
scanf(“%d”,&ch);

switch(ch)
{
case 1: printf(“nSunday”);
break;
case 2: printf(“nMonday”);
break;
case 3: printf(“nTuesday”);
break;
case 4: printf(“nWednesday”);
break;
case 5: printf(“nThursday”);
break;
case 6: printf(“nFriday”);
break;
case 7: printf(“nSaturday”);
break;
}
getch(); //to stop the screen
}

5 thoughts on “C program to input number of week's day(1-7) and translate to its equivalent name of the day of the week”

Leave a Comment

Your email address will not be published. Required fields are marked *