My teacher showed me something like this with functions but I don't quiet get it. Since, I can't ask him right now...I came here for help.

I'm suppose to write a function to display days in a month. This is my first time using functions so all the help I can get is thankful and useful!
I know this program is filled with errors... but like i said I'm lost and don't get it.

int dInMonth(int month);

int main()
{
cout<<"Please enter your number of months ";
cin>>month;

int d = dInMonth(month);
cout<<d<<endl;

    return 0;
}
int dInMonth(int month)

{


if (month == 4 || month == 6 || month == 9 || month == 11)
	Days = 30;

	else if (month == 2)
	{

        Days = 28;
	}
		else
		Days = 31;
return Days;
}

NVM GUYS I GET IT!!!

No need for help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.