#include<stdio.h>
#include<conio.h>
struct date
{
int d,m,y;
};
void main()
{
int i;
struct date date[2];
clrscr();
for(i=0;i<2;i++)
{
printf("enter date,month,year:");
scanf("%d %d %d",&date[i].d,&date[i].m,&date[i].y);
}
for(i=0;i<2;i++)
{
if(date[i].m==1)
{
printf("jan");
}
else if(date[i].m==2)
{
printf("feb");
}
else if(date[i].m==3)
{
printf("march");
}
else if(date[i].m==4)
{
printf("april");
}
else if(date[i].m==5)
{
printf("may");
}
else if(date[i].m==6)
{
printf("june");
}
else if(date[i].m==7)
{
printf("july");
}
else if(date[i].m==8)
{
printf("august");
}
else if(date[i].m==9)
{
printf("sep");
}
else if(date[i].m==10)
{
printf("oct");
}
else if(date[i].m==11)
{
printf("nov");
}
else
{
printf("dec");
}
}
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.