Is there an analogous form of the following code:
if(month == 4,6,9,11)
{
do something;
}
Or must it be:
if(month == 4 ||
If you're using C or Java, you can do this:
switch (month) {
case 4:
case 6:
case 9:
case 11:
do something;
break;
}
In some languages, you could even write case 4,6,9,11:.
Other possibilities would be to create an array [4,6,9,11], some functional languages should allow something like if month in [4,6,9,11] do something;
As Lior said, it depends on the language.
EDIT: By the way, you could also do this (just for fun, bad code because not readable):
if ((abs(month-5) == 1) || (abs(month-10) == 1)) do_something;