Use one variable to store three data: Design a program that use data type:int,le
ID: 3613617 • Letter: U
Question
Use one variable to store three data:Design a program that use data type:int,length:2 bytes variable “date” to store threevariable
“day”, “month”,and “year”.
(1). Input these three variable “day”,“month”, and “year” into variable“date”:
Hint: Design a formula converts the actual three data into thevariable “date”,
according to the format of the 2-byte integer variable“date” provided by yourself.
(2). Extract the three data from variable“date”
Explanation / Answer
please rate - thanks #include using namespace std; int main() {int i; unsigned int date,month, day, year; coutmonth; coutday; coutyear; month=monthRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.