Question: Consider the following R code answer = c(2, 7, 1, 5, 12, 3, 4) for(j in 2 : length(answer)){answer[j] = max(answer[j], answer[j 1])} answer[7] The

Consider the following R code

answer = c(2, 7, 1, 5, 12, 3, 4) for(j in 2 : length(answer)){answer[j] = max(answer[j], answer[j 1])} answer[7]

The output of the R code will be a. 2 b. 7 c. 12 d. 4 e. none of above

Consider the following R code

answer = c(2, 7, 1, 5, 12, 3, 4) for(j in 2 : length(answer)){answer[j] = sum(answer[j], answer[j 1])} answer[3]

The output of the R code will be a. 2 b. 7 c. 10 d. 9 e. none of above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!