-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDaysConvert.c
More file actions
26 lines (21 loc) · 785 Bytes
/
Copy pathDaysConvert.c
File metadata and controls
26 lines (21 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*----------------------------------------------------------------------------------------------------------------------------------------------------------
DaysConvert.c
Program to convert days into years, months and days
DIVYA RAJ K
09-09-2018
-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#include<stdio.h>
main()
{
int Days,Years,Months,NumDays;
system("clear");
printf("Program to convert days into years, months and days\n\n");
printf("Enter the total number of days:\n");
scanf("%d",&Days);
NumDays=Days;
Years=Days/365;
Days=Days%365;
Months=Days/30;
Days=Days%30;
printf("\n%d days = %d years %d months and %d days",NumDays,Years,Months,Days);
}