Search This Blog

Translate

C program to read days and convert it into year, month and day,

C program  to read days and convert it into year, month and day,
C program  to accept days and convert it into year, month and day,
#include
#include
void main()
{
int days,y=0,m=0,d=0;
clrscr();
printf("Enter the days=");
scanf("%d",&days);
while(days>0)
{
if(days>=365)
{
y++;
days=days-365;
continue;
}
if(days>=30)
{
m++;
days=days-30;
continue;
}
if(days<30 font="">
{
d=days;
break;
}

}
printf("\n\n After converting the days in year,month and days format=");
printf("\n\n\nYear=%d \n\n Month=%d \n\n Days=%d",y,m,d);
getch();
}


C program  to read days and convert it into year, month and day,
C program  to accept days and convert it into year, month and day,

C Program example List

Google+ Badge