Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write an R program to find the mean of a given vector.

Easy

Problem Statement

Write an R program to find the mean of a given vector.

Sample Input

Vector: [10, 20, 30, 40, 50]

Sample Output

Mean: 30

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
# Predefined structure vector <- c(10, 20, 30, 40, 50) mean_value <- mean(vector) print(paste("Mean:", mean_value))
Log in or sign up to run or submit your code.Log inSign up
Input
Vector: [10, 20, 30, 40, 50]
Expected Output
Mean: 30