Write a C++ Program to Convert Days to years and weeks with an example. This C++ program allows the user to enter the total number of days and convert those days into years and weeks.
#include<iostream>
using namespace std;
int main()
{
int numOfDays, years, weeks;
cout << "\nPlease Enter the Number of Days = ";
cin >> numOfDays;
years = numOfDays / 365;
weeks = (numOfDays % 365) / 7;
cout << "\nYears = " << years;
cout << "\nWeeks = " << weeks;
return 0;
}