#include <stdio.h>
void main()
{
struct date
{
int d,m,y;
}date[2];
int a=0;
clrscr();
while(a!=2)
{
printf("\nEnter date %d (dd-mm-yyyy) :\n",a+1);
flushall();
scanf("d",&date[a].d);
flushall();
scanf("%d",&date[a].m);
flushall();
scanf("Year - %d",&date[a].y);
a++;
}
a=0;
printf("\n");
while(a!=2)
{
printf("\nDate %d Month : ",a+1);
switch(date[a].m)
{
case 1 : printf("January"); break;
case 2 : printf("February"); break;
case 3 : printf("March"); break;
case 4 : printf("April"); break;
case 5 : printf("May"); break;
case 6 : printf("June"); break;
case 7 : printf("July"); break;
case 8 : printf("August"); break;
case 9 : printf("September"); break;
case 10 : printf("October"); break;
case 11 : printf("November"); break;
case 12 : printf("December"); break;
default : printf("Invalid date!");
}
a++;
}
getch();
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.