# R Programming: Find Sum, Mean and Product of a Vector

## R Programming: Vector Exercise-6 with Solution

Write a R program to find Sum, Mean and Product of a Vector.

**Sample Solution** :

**R Programming Code :**

```
x = c(10, 20, 30)
print("Sum:")
print(sum(x))
print("Mean:")
print(mean(x))
print("Product:")
print(prod(x))
```

Sample Output:

[1] "Sum:" [1] 60 [1] "Mean:" [1] 20 [1] "Product:" [1] 6000

**R Programming Code Editor:**

**Have another way to solve this solution? Contribute your code (and comments) through Disqus.**

**Previous:** Write a R program to divide two vectors of integers type and length 3.

**Next:** Write a R program to find Sum, Mean and Product of a Vector, ignore element like NA or NaN.

Test your Programming skills with w3resource's quiz.

**What is the difficulty level of this exercise?**

**Weekly Trends and Language Statistics**- Weekly Trends and Language Statistics