What is the value of equation1(3) for the following R code?

Category: R LanguageWhat is the value of equation1(3) for the following R code?
Editor">Editor Staff asked 2 years ago

What is the value of equation1(3) for the following R code?

1 Answers
Editor">Editor Staff answered 2 years ago

> num <- 4
> equation1 <- function (val)
+ {
+ num <- 3
+ num^3 + g (val)
+ }
> equation2 <- function (val)
+ {
+ val*num
+ }
}
For the above code snippet, we obtain the output as 39.