Q:

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

belongs to collection: C++ Basic Solved Programs

0

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.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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 .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Basic Solved Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a C++ Program to Convert Days Into Years Wee... >>
<< Write a C++ Program to find Addition of Two Number...