C Programming

C Program to Convert Entered Number of Days into Years, Months and Days

C Code

#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();
}

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.