magic dates...

i need help... i tried to figure this out by myself but i cant do it -_-

The date June 10, 1960 is special because when we write it in the following format,
the month times the day equals the year.
Write a program that asks the user to enter a month (in numeric form), a day, and a
two-digit year. The program should then determine whether the month times the day
is equal to the year. If so, it should display a message saying the date is magic. Otherwise
it should display a message saying the date is not magic.

Last edited on
Could you show what you tried? We can help from there.
i have actually figured it out now...i just had to stare at the problem for a while ha
int month, day, year;
int magic;

cout << "please enter a month in numeric form"<< endl;
cin >> month;

cout << "please enter a day"<<endl;
cin >> day;

cout << "please enter a year"<< endl;
cin >> year;

magic = (month * day);

if (magic == year)
cout << "it is magic"<<endl;;
cout << "it is not magic" << endl;

Topic archived. No new replies allowed.