Week Days corresponding to digits 1-7 coderinme

Week Days corresponding to digits 1-7

Week Days corresponding to digits 1-7 coderinme
As we already know that there are seven days in a week.
So 1 corresponds to Sunday, 2 to Monday, 3 to Tuesday, 4 to Wednesday, 5 to Thursday, 6 to Friday and 7 to Saturday. Let us code To find the week-day by entering corresponding digit from the keyboard (from 1 to 7) using switch case, we code as follows

#include<stdio.h>
int main()
{
int a;
printf("Enter the Number: ");
scanf("%d",a);
switch(a)
{
case 1 :
printf("It is Sunday");
break;
case 2 :
printf("It is Monday");
break;
case 3 :
printf("It is Tuesday");
break;
case 4 :
printf("It is Wednesday");
break;
case 5 :
printf("It is Thursday");
break;
case 6 :
printf("It is Friday");
break;
case 7 :
printf("It is Satuarday");
break;
default: 
printf("Please Enter the correct digit");
}
getch();
return 0;
}

For more programs in C, visit our C Coder Archives

Week Days corresponding to digits 1-7 coderinme

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator” to the admin @coderinme

Leave a reply:

Your email address will not be published.