R, versions 2 and 3, 16 bytes
exists("cite")+2
This command returns 2
for R 2.x.x and 3
for R 3.x.x. The function cite
was added in R version 3.0.0. Therefore, the command exists("cite")
returns FALSE
for R 2.x.x and TRUE
for R 3.x.x.
R, all versions (1, 2, and 3), 33 bytes
exists("cite")+exists("eapply")+1
The function eapply
was introduced in R 2.0.0.