MATL, 9 bytes
14Liq:)hs
Explanation
14L % Push [31 28 31 30 31 30 31 31 30 31 30 31]: (*)month lengths (predefined literal)
i % Input: month, m
q % Subtract 1
: % RangeInclusive range from 1 to that
) % Index into (*)the array of month lengths: gives theits first m-1 terms in (*)
h % Implicit input: day, d. Concatenate with previous array
s % Sum of array. Implicit display
MATL, 9 bytes
14Liq:)hs
Explanation
14L % Push [31 28 31 30 31 30 31 31 30 31 30 31] (*) (predefined literal)
i % Input: month, m
q % Subtract 1
: % Range from 1 to that
) % Index into (*): gives the first m-1 terms in (*)
h % Implicit input: day, d. Concatenate with previous array
s % Sum of array. Implicit display
MATL, 9 bytes
14Liq:)hs
Explanation
14L % Push [31 28 31 30 31 30 31 31 30 31 30 31]: month lengths (predefined literal)
i % Input: month, m
q % Subtract 1
: % Inclusive range from 1 to that
) % Index into the array of month lengths: gives its first m-1 terms
h % Implicit input: day, d. Concatenate with previous array
s % Sum of array. Implicit display
MATL, 9 bytes
14Liq:)hs
Explanation
14L % Push [31 28 31 30 31 30 31 31 30 31 30 31] (*) (predefined literal)
i % Input: month, m
q % Subtract 1
: % Range from 1 to that
) % Index into (*): gives the first m-1 terms in (*)
h % Implicit input: day, d. Concatenate with previous array
s % Sum of array. Implicit display