Thursday, 10 March 2016

C Program To Print Day of Week Name Using Switch Case

Problem:- C program to print day of week name using switch case or Display Day Name according to the Day Number using Switch Case or C Program to Print Days of Week in Words using Switch Case Statement or Program in C to Display day of week using switch case or Days of week using switch case or C program to input number of week's day(1-7) and translate to its equivalent name of the day of the week or Simple C Program for Switch case to Find weekdays name or print Days of Week using switch-case or program to print days of week using switch.

Check This:- Hacker rank solution for Strings, Classes, STL, Inheritance in C++.


Explanation:- In this problem, we have to find the day, let's take an input as an example suppose user enter 5(User input should be between 1 to 7 ) than out program will print the message on screen " Today Is Friday ", and for other input it will print the appropriate message on screen. If user think he is smart and he is trying to enter some other than values 1 to 7 then program will print the message " Don't be Smart Wrong Choice Try Again!!!". program will work only if values are 1 to 7.

Also Check:- Geeksforgeeks solution for School, Basic, Easy, Medium, Hard in C++.

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date for a new post or if you have any Query you can ask there with lots of coders also suggest to your Friends to join and like our page, so we can help our community, and don't forget to Subscribe. Enter your Email and click to subscribe.


Solution:-

#include<stdio.h>

main()
{
 /*Visit - www.programmingwithbasis.com*/
int choice;

printf("Monday Willbe First Days and So On\n\n");
printf("Enter Any Number Between (1 to 7):");
scanf("%d",&choice);
printf("\n");
switch(choice)
{
case  1:
printf("Today is Monday");
break;
case  2:
printf("Today is Tuesday");
break;
case  3:
printf("Today is Wednesday");
break;
case  4:
printf("Today is Thursday");
break;
case  5:
printf("Today is Friday");
break;
case  6:
printf("Today is Saturday");
break;
case  7:
printf("Today is Sunday");
break;
default:
printf("Don't Be Smart....Wrong Choice Try Again!!!");
}
getch();
}

Output:-
C Program To Print Day of Week Name Using Switch Case



You May Also See

1. C Program To Find Area And Circumference Of Circle

2. C Program To Print ASCII Value Of Character

3. C Program To Find Area Of Triangle 



Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Ghanendra Yadav

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment