Thursday, February 12, 2015
C program to input number of weeks 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 weeks day(1-7):");
scanf("%d",&ch);
switch(ch)
{
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;
}
getch(); //to stop the screen
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.