Testing out a program that calculates the days left in the month
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.