Skip to main content

Write a program to enter 1 to 7 case and display day of week.


//Write a program to enter 1 to 7 case and display day of week.
#include<stdio.h>
#include<conio.h>
void main()
{ int day;
clrscr();
printf("Enter number between 1 to 7");
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("Thusday");
 break;
 case 6:printf("Friday");
 break;
 case 7:printf("Saturday");
 break;
 default:printf("Invalid input");
}
getch();
}

Comments

Our Popular Posts

WAP to enter three numbers and find middle number among them.

// WAP to enter three numbers and find middle number among them. #include<stdio.h> #include<conio.h> void main ( ) { int a , b , c ; clrscr ( ) ; printf ( "Enter three number: \n " ) ; scanf ( "%d%d%d" ,& a ,& b ,& c ) ; if ( ( a > b && a < c ) || ( a > c && a < b ) ) printf ( "%d is middle number" , a ) ; else if ( ( b > a && b < c ) || ( b > c && b < a ) ) printf ( "%d is middle number" , b ) ; else printf ( "%d is middle number" , c ) ; getch ( ) ; } Output:

CTEVT I/II (2073) Electrical Engineering

CTEVT 1st Year/ 2nd Part Subject : Electrical Engineering Year : 2073 Program : Diploma in Computer / IT Eng. (New) Page contain : 2

HSEB-GRADE XI (2072) Physics

HSEB +2 Science 1st year Year : 2071 (2014) Subject : Physics (New Course) Pages contain : 4 Page-1 Page-2 Page-3 Page-4