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 .
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 : :
OUTPUT : :
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