Skip to content

Help with C++ :(

Xeronator··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

ContDeCaterinca13 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 Shaper1 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 Pala1 votes

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

Xeronator1 votes

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

More from General Discussion

More by Xeronator