Write a C Program to Enter Days and convert them into year, month and days.
Write a C Program to Enter Days and convert them into year, month and days.
Here is the C Program to convert the days into Year , Month and Days. The days are taken as input from user.
#include<stdio.h>
#include<conio.h>
void main()
{ int day,month,year;
clrscr();
printf(“Enter Total Days:\n”);
scanf(“%d”,&day);
year=day/365;
day=day%365;
month=month/30;
day=month%30;
printf(“Year=%d\nMonth=%d\nDay=%d\n,year,month,day);
getch();
}
Output