Monday, October 26, 2020

Days To Years, Weeks, and Days in C++

 I will show you how to write a program using a C++ programming language that accepts days as integer and display the total number of years, months, and days in it.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price.


Program Listing

// days.cpp
// Jake R. Pomperada, MAED-IT,MIT
// www.jakerpomperada.com / www.jakerpomperada.blogspot.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental, Philippines

#include <iostream>

using namespace std;

int main()
{
int days=0,y=0,m=0,d=0;

cout <<"\n\n";
cout <<"\tDays To Years, Weeks, and Days in C++";
cout <<"\n\n";
cout <<"\tGive Number of Days : ";
cin>>days;

y=(days/365);
days=(days%365);
m=(days/30);
d=(days%30);

cout <<"\n\n";
cout <<"\tNumber of Years  : " <<y<<"\n";
cout <<"\tNumber of Months : " <<m<<"\n";
cout <<"\tNumber of Days   : " <<d <<"\n";
    cout <<"\n\n";
    cout << "\tEnd of Program";
    cout <<"\n\n";
}

No comments:

Post a Comment