Answer to Question #310636 in C++ for Christine Traya

Question #310636

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



1
Expert's answer
2022-03-14T08:37:37-0400
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);




}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment