Write a C++ Program to Convert Days Into Years Weeks and Days

By | 24.12.2016

Convert Days Into Years Weeks and Days


Write a C++ Program to Convert Days Into Years Weeks and Days. Here’s simple Program to Convert Days Into Years Weeks and Days in C++ Programming Language.


Here is source code of the C++ Program to Convert Days Into Years Weeks and Days. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.


SOURCE CODE : :


/*  C++ Program to Convert Days Into Years Weeks and Days  */

#include<iostream>

using namespace std;

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

    cout<<"Enter No. of days :: ";
    cin>>d;

    y=d/365;
    d=d%365;
    w=d/7;
    d=d%7;

    cout<<"\nNo. of Years: : "<<y<<"\nNo. of Weeks :: "<<w<<"\nNo. of Days :: "<<d<<"\n";

    return 0;
}

OUTPUT : :


/*  C++ Program to Convert Days Into Years Weeks and Days  */

Enter No. of days :: 1234

No. of Years: : 3
No. of Weeks :: 19
No. of Days :: 6

Process returned 0

Above is the source code for C++ Program to Convert Days to Years Weeks and Days which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

3.3 23 votes
Article Rating
Category: Basic Programs C++ Programming Tags:

About Tunde A

My name is Tunde Ajetomobi, a Tech Enthusiast and Growth Hacker. I enjoy creating helpful content that solves problem across different topics. Codezclub is my way of helping young aspiring programmers and students to hone their skills and find solutions on fundamental programming languages.

Subscribe
Notify of
guest
5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Muhammad mubshir

Write a programme year month week day hour minute second

MADHU

U guys missed a condition i e leap year one!

Fateh Ahsan

Where are you from?

PRINCESS BULAWAN

Write a c++ program to convert days to years,weeks and days
.
Enter Days:360
Years: 0
Weeks: 51
Days: 360

sdsada
  1. sdssfsfsdfsfsfsfsdfssdfsdfsdffsdfsdsssfsfsdfsdffdsfsdfsdfsdfsdfsdfsfsfs
  2. sfsdfsdfs
  3. fsdfsdfsd
  • fsdfSFsdFSDfSDFsfSf
  • sDFs
  • DFsD
  • FsD

FSDFSDFsDFsdfSDF

sDF

SDF

SDFSDFSDFSDFsdFsdfSffsFSF
SDFSDF
sDFSFS
FSFSDFSDFsfSFs
sDFS
DFdsfSDF 
sfsFdfSF