C++ Program to Convert Days Into Years, Weeks and Days

Below I have shared the C++ program to convert given number of days into years, weeks and days.

 

For example if user has entered 365 days (not a leap year) then the output will be:

 

Years: 1
Weeks: 0
Days: 0

 

 

If you have any problem regarding above years, weeks and days program then you can ask it by commenting below.

8 thoughts on “C++ Program to Convert Days Into Years, Weeks and Days”

    1. #include

      using namespace std;

      int main()
      {
      int y,d,m;

      cout<>d;

      y=d/365;
      d=d%365;
      m=d/30;
      d=d%30;

      cout<<"\nYears: "<<y<<"\nMonths: "<<m<<"\nDays: "<<d;
      return 0;
      }

Leave a Comment

Your email address will not be published. Required fields are marked *