Write a C program to input number of days from user and convert it to years, weeks and days. How to
convert days to years, weeks in C programming. Logic to convert days to years, weeks and days in C
program.
convert days to years, weeks in C programming. Logic to convert days to years, weeks and days in C
program.
- //hey guys why are you getting more complicated just use this
- #include<stdio.h>
- int main()
- {
- int days,months,years,weeks;
- printf("\Enenter the days :");
- scanf("%d",&days);
- years=days/365;
- months=days/30;
- weeks=days/7;
- printf("\nyears :%d\ndays :%d\nmonths :%d\nweeks :%d",years,days,months,weeks);
- }