C Program to Convert a Given Number of Days into Months and Days

In this program, the user is asked to enter the number of days, depending on it will display the months and days count.

Source Code
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

"Coding Hub - Learn to code" app now available on Google Play Store