Help with C++ :(

Xeronator·2/17/2019, 12:28:08 PM·1 votes·964 views

"Write a relational expression that is true if the current day is the 15th day of the first month. The current day is stored in variables MM for month, YY for year and DD for day."

4 Comments

ContDeCaterinca12/17/2019, 12:48:34 PM3 votes

Are you like totally new to C++? Cuz this one is like something you just have to check with "if" clause.

bool check; // or whatever you want to name it

if(DD==15 && MM==1) check=true; else check=false;

cout<< check << endl;

Stars Shaper2/17/2019, 12:38:45 PM1 votes

First of all define the variables MM, DD and YY as integers, ask the user to input the date and then you need 2 IFs, one to check that DD = 15 and then that MM = 1 (unless "first month" has another menaing than January).

Lv60 Retri Pala2/17/2019, 12:42:59 PM1 votes

if(DD==15 && MM==1){}

Xeronator2/17/2019, 6:08:29 PM1 votes

Thank you guys!!! And yes I’m new to C++ lol