R Program to find the sum mean product of two vectors
Program
x <- sample(1:10, 5, replace = TRUE)
print(x)
print(paste("Sum of random vector", sum(x)))
print(paste("Mean of the vector", mean(x)))
print(paste("Product of vector", prod(x)))
Output
[1] 8 4 2 3 2
[1] "Sum of random vector 19"
[1] "Mean of the vector 3.8"
[1] "Product of vector 384"