In this program, the user is asked to enter the number of days, depending on it will display the months and days count.
#include<iostream>
using namespace std;
int main()
{
int days, months;
cout<<"Enter days: ";
cin>> days;
months = days / 30;
days = days % 30;
cout<<"Months = " << months;
cout<<"\nDays = " << days;
return 0;
}
Enter days: 265
Months = 8
Days = 25