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
#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<<"\nYears: "<<y<<"\nWeeks: "<<w<<"\nDays: "<<d; return 0; }
If you have any problem regarding above years, weeks and days program then you can ask it by commenting below.
how to get the result in yr month and days
#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;
}
sir! can you write a program to form a complete Christmas tree with using c++
Thnx
Wap in c++ to create matrix 4*4 and display
leap year has 366 days, number of days/365 is it really reliable
what is we colculate age in seconds?
I need to this site