#include <cstdlib>
using namespace std;
int main()
{
//define a list of vars & input
int month;
int day;
int year;
//processing
//output
cout<<"Enter Month: "<< "Press Enter Key" <<endl;
cin >> month;
cout<<"Enter Day: "<< "Press Enter Key" <<endl;
cin >> day;
cout<<"Enter Year: "<< "Press Enter Key" <<endl;
cin >> year;
int date = int (month * day);
if (date == year)
cout<<"date"<<"is not magic"<<endl;
else
cout<<"date"<<"is magic"<<endl;
return 0;
}
I'm trying to 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, also to put the date in numeric form. Just started learning c/c++ recently and having trouble understanding it.