0

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;
}

Edited by myrongainz: n/a

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by myrongainz
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.