ANSWERS: 2
-
Is this some kind of homework question?
-
I hope this is not a homework question...but according to the way I see it, you get out of school what you put into school. The students that don't choose to learn from their assignments (and waste tons of money in the process) become one less competitor in the job market, making it easier for the ones that do learn to get successful careers in the field. You'll get one, and only one freebie from me. My advice is to take this as reference only. ...and as your question is not complete (I do not know what needs to be displayed) neither will the program be. You'll have to edit the code accordingly. The tricky part here is the "year % (MOD) 100" to give you the remainder of that division problem...or the last two digits. Learn the MOD operator, as C100 level professors love using it as a curve-ball. #include <iostream> using namespace std; void main() { int month, day, year; cout << "Enter the month: "; cin >> month; cout << "Enter the day: "; cin >> day; cout << "Enter the year: "; cin >> year; if ((month * day) == (year % 100)) { //what do you need to display if they are equal? } else { //what do you need to display if there are not? } }
Copyright 2023, Wired Ivy, LLC

by 