write a program to input number of days from the user and convert to it years weeks and days and display the result on the screen
// days.cpp
// Author: Mr jake R. pomperada, BSCS, MAED- IT
// Date: august 15, 2018 Wednesday
// Location: Bacolod City, Negros occidental
// Website: http://www.jakerpompereda.com
using namespace std;
// write a program to input number of days from the user and convert to it years weeks and days and display the result on the screen
main(void)
{
unsigned long No_of_Days;
int yy, ww, dd;
cout<<"\n\nEnter No. of days: "; cin>>No_of_Days;
yy = No_of_Days/365;
ww = (No_of_Days%365)/7;
dd = (No_of_Days%365)%7;
cout<<"\n\nResult: "<<yy<<" Years "<<", "<<ww<<" Weeks and "<<dd<<" days.";
return(0);
}
Comments
Leave a comment