Testing out a program that calculates the days left in the month I'm new to coding C++ and I want to get some insight on my progress. Can you guys take a look at my program and give me some feedback on it? 

#include &lt;iostream&gt;
using namespace std;

int main(){

int day{};
int monthNum{};
cout &lt;&lt; "Calculate how many days are left in the month. \nPlease enter the month number and the day, seperated by a space. ex 1 22 for Jan 22nd: ";
cin &gt;&gt; monthNum &gt;&gt; day;

if (monthNum &lt; 1 || monthNum &gt; 12 || day &lt; 1 || day &gt; 31 || (monthNum == 2 &amp;&amp; (day &lt; 1 || day &gt; 29))){
    cout &lt;&lt; "Error, not a valid input. \nPlease make sure you're month and day are valid." &lt;&lt; endl;
    return 0;
}

int daysInCurrentMonth{};
char leapYear;
int doNothing{};  //Used to do nothing if certain conditions are false

if (monthNum == 2){
    cout &lt;&lt; "\nIs it leap year? Type y for yes and n for no. ";
    cin &gt;&gt; leapYear;
    ((leapYear == 'y') ? daysInCurrentMonth = 29 : daysInCurrentMonth = 28);
    if (leapYear != 'y' &amp;&amp; leapYear != 'n'){
        cout &lt;&lt; "invalid input..." &lt;&lt; endl &lt;&lt; endl;
        return 0;
    }else{ 
        doNothing = 0;
    }
}

cout &lt;&lt; "\nYou entered day " &lt;&lt; day &lt;&lt; " of month " &lt;&lt; monthNum &lt;&lt; endl;

((monthNum == 4 || monthNum == 6 || monthNum == 9 || monthNum == 11) ? daysInCurrentMonth = 30 : doNothing = 0);
((monthNum == 1 || monthNum == 3 || monthNum == 5 || monthNum == 7 || monthNum == 8 || monthNum == 10 || monthNum == 12) ? daysInCurrentMonth = 31 : doNothing = 0);

int daysLeftInMonth{daysInCurrentMonth - day};
cout &lt;&lt; "\nThere are " &lt;&lt; daysLeftInMonth &lt;&lt; " days left in the month." &lt;&lt; endl;

cout &lt;&lt; endl;
return 0;
}


This is my third iteration of this program. This is the tutorial series that I've been watching. I'm currently on section 9 and just finished learning about conditional operators. I'm trying to refine the project as I go along. Also, I know it's pretty early to be thinking about this, but if anyone is able to, I'd like to know if the way I structure this is in the right direction for becoming a professional programmer, i.e. it's easy to follow and is readable, or it looks like garbage.
Don't use using namespace std 
Prefer using \n over std::endl
The last return 0 is not necessary in this case as the compiler will generate it for you
When using the ternary operator you can just assign at the start instead of having to do it in both branches
Not part of the code but you should check your spelling 


I'm not sure if you do the input on purpose to learn how it works but it can be done without user interaction.
Have a look at ctime as it offers many functions that can be useful here.

Here's a small program showcasing how to use those functions:

#include &lt;ctime&gt;
#include &lt;iostream&gt;

int main() {
    std::time_t time = std::time(nullptr);
    auto today = std::localtime(&amp;time);

    int day = today-&gt;tm_mday;
    int month = today-&gt;tm_mon + 1;
    int year = today-&gt;tm_year + 1900;
    int month_length = 30;

    constexpr int february = 2;
    if (month == february) {
        month_length = is_leapyear(year) ? 29 : 28;
    }

    std::cout &lt;&lt; month_length - day &lt;&lt; " days remain in this month.\n";
}


Since the is_leapyear function is trivial I left it out.

Of course if you're using C++20 then you can just use chrono which offers an amazing amount of time and date related functions.