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

0
4
digitalample eye
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=%dnMonth=%dnDay=%d",year,month,day);
getch();
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here