1. Lol, yes March has 31 days. I should have used the knuckle method to find that out.

2. you guys are all blooldy legends first of all and thx for the enum method slingerland3g
but can someone explain to me how the enumeriatsaion method works
and can someone give me some tips on how to convert years into words>??? cause i have absolute no idea

3. Enumeration is like defining an integer type, but only allowing the values 0, 1, 2. If the user tries to assign anything other than a 0, 1, 2, you get an error.

Code:
```typedef enum
{
ENUMERATION_1,
ENUMERATION_2,
ENUMERATION_3
} enumeration;

enumeration a;
enumeration b;```
It's useful for assigning descriptive names to certain values that a variable can take.

4. so since i have to create a calender from january to decemeber
enumeration wont work eh cause it only works for intergers for 0, 1, 2 but not 3 onwards...
so what other methods can i use if i did to include integers from 0 to 12

5. cause it only works for intergers for 0, 1, 2 but not 3 onwards
Why do you say so? enum could include any integer you want

integers from 0 to 12
Why do you need 13 months?

6. for marking an error code

7. hi guys im just wondering how to make an else if comment this is what i got so far....
if (month == January)
printf("Janurary has 31 days\n");
else if ((month == February)&& (((year&#37;4==0 )&& (year%100!=0)) || ((year%400==0) && (year%100==0)&& (year%4==0))))
{ printf("February has 29 days\n");
}
else
{ printf ("February has 28 days\n");
}

However it does not work

8. use switch

Code:
```enum months {Jan,Feb,Mar,...} month;
switch(month)
{
case Jan: ...
break;
case Feb:
...
}```

9. u mind explaining briefly about how switch works plz?

10. Originally Posted by bobbie18
hi guys im just wondering how to make an else if comment this is what i got so far....
if (month == January)
printf("Janurary has 31 days\n");
else if ((month == February)&& (((year%4==0 )&& (year%100!=0)) || ((year%400==0) && (year%100==0)&& (year%4==0))))
{ printf("February has 29 days\n");
}
else
{ printf ("February has 28 days\n");
}
However it does not work
Post code within code tags! and indent properly.
Code:
```if (month == January) {
printf("Janurary has 31 days\n");
} else if ((month == February) &&
( ((year%4 == 0 ) && (year%100 != 0)) ||
((year%400 == 0) && (year%100 == 0) && (year%4 == 0))
)
) {
printf("February has 29 days\n");
} else {
printf ("February has 28 days\n");
}```
Also use braces with all if/else statements or at least don't mix an if statement without braces with an else statement with braces!
I've also re-aligned your if statement a bit, so you can see whether you're doing what you're intending to do.

QuantumPete

11. hi i sort of fixed it but don't know what i did wrong when i want the printf statement to be Feb has 29 days when it's a leap year... Code as follow: THX A LOT GUYS

switch(month)
{
case January:
printf("January has 31 days\n");
break;
case February:
printf("February has 28 days\n");
break;
case (((year&#37;4==0 )&& (year%100!=0)) || ((year%400==0) && (year%100==0)&&
(year%4==0))) February:
printf("February has 29 days\n");
}

12. You need to put the condition to examine if it's a leap-year inside the case for February:
Code:
```if (leap_year) ... 29
else ... 28```
The case-label, e.g. Februry, must be constant, it can not be "an equation" - it MUST be something that the compiler can figure out at compile time into a simple number.

--
Mats

13. This might work by repetitive instruction:
use code tags.

QuantumPete

14. Code:
```#include <stdio.h>

int main()
{
int year, month;
enum months{January = 1, February, March, April, May, June, July,
August, September, October, November, December};

printf("Enter year and month:");
scanf("%d %d", &year, &month);
if (((year%4==0 )&& (year%100!=0)) || ((year%400==0) && (year%100==0)&&
(year%4==0)))
{
printf("has three hundred and sixty six (366) days\n");
}
else
{
printf("has three hundred and sixty five (365) days\n");
}

switch(month)
{
case January:
printf("January has 31 days\n");
break;
case February:
printf("February has 28 days\n");
break;
case (((year%4==0 )&& (year%100!=0)) || ((year%400==0) && (year%100==0)&&
(year%4==0))) February:
printf("February has 29 days\n");
}

return 0;
}```