In this program, the user is asked to enter the number of days, depending on it will display the months and days count.
#include<stdio.h>
int main()
{
int days, months;
printf("Enter days: ");
scanf("%d", &days);
months = days / 30;
days = days % 30;
printf("%d months and %d days", months, days);
return 0;
}
Enter days: 265
8 months and 25 days