C Program to convert days into years, days and months.

Write a program to convert entered number of days into years, months and days. Convert days into years, months, and days. C Program to convert days into years, months and days. Programming code to convert days into years, days and months.

Write a program to convert entered number of days into years, months and days.
Convert days into years, months, and days.
C Program to convert days into years, months and days.
Programming code to convert days into years, days and months.

C Code


Write a program to convert entered number of days into years, months and days.
#include <stdio.h>
#include <conio.h>
void main()
{
 int d,year,month,day,remd;
 clrscr();
 printf("Enter the number of days to convert:");
 scanf("%d",&d);
 year=d/365;
 remd=d%365;
 month=remd/30;
 day=remd%30;
 printf("Year=%d\nMonth=%d\nDay=%d",year,month,day);
 getch();
}

You May Also Like...