Given number of days, convert it in terms of Years, Week and Days.
Input : 30 Output : years = 0 week = 4 days = 2 Input : 20 Output : years = 0 week = 2 days = 6
- Number of years will be the quotient when number of days will be divided by 365 i.e days / 365 = years.
- Number of weeks will be the result of (Number_of_days % 365) / 7.
- Number of days will be the result of (Number_of_days % 365) % 7.
Below is the program implementing above approach:
years = 0 weeks = 28 days = 4
- Python program to find number of days between two given dates
- Find number of days between two given dates
- PHP | Number of week days between two dates
- Date after adding given number of days to the given date
- Converting seconds into days, hours, minutes and seconds
- Program to Convert Hexadecimal Number to Binary
- Program to print the series 2, 1, 4, 3, 6, 5, .... up to N terms
- Program to find the sum of the series 23+ 45+ 75+..... upto N terms
- Find n terms of Fibonacci type series with given first two terms
- Program to Convert Radian to Degree
- Program to convert speed in km/hr to m/sec and vice versa
- Program to Convert Km/hr to miles/hr and vice versa
- Python Program to convert Kilometers to Miles
- Program to convert Centimeter to Feet and Inches
- Program to convert KiloBytes to Bytes and Bits
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t