1. What will be the output of the following code ? > x <- 3 > switch(2, 2+2, mean(1:10), rnorm(5)) a) 5 b) 5.5 c) NULL d) All of the mentioned AnswerAnswer: b [Reason:] If value is a number between 1 and the length of list then the corresponding element of list is evaluated and…