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.

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

    1. Rakshith V R

      #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;
      }

      Reply
  1. ramkrishna

    sir! can you write a program to form a complete Christmas tree with using c++

    Reply
  2. mang

    leap year has 366 days, number of days/365 is it really reliable

    Reply

Leave a Reply

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