Convert Total days to year, month and days
Write a C program to convert Total days to year, month and days. Here’s simple program to convert Total days to year, month and days in C Programming Language.
Below is the source code for C program to convert Total days to years, month and days which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
/* C program to convert Total days to year, month and days */ #include <stdio.h> int main(void) { int d,y,m,nd; printf("Enter number of days :: "); scanf("%d",&d); y=d/365; d=d%365; m=d/30; nd=d%30; printf("\n%d years, %d months, %d days\n",y,m,nd); return 0; }
OUTPUT : :
Enter number of days :: 560 1 years, 6 months, 15 days
Above is the source code for program to convert Total days to year, month and days which is successfully compiled and run on Windows System.The Output of the program is shown above .
If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.
Thanks for reading the post….