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

Programming Exercises

Write an R program to find the maximum value in a vector.

Easy

Problem Statement

Write an R program to find the maximum value in a vector.

Sample Input

Vector: [3, 8, 1, 15, 6]

Sample Output

Maximum Value: 15

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
# Predefined structure vector <- c(3, 8, 1, 15, 6) max_value <- max(vector) print(paste("Maximum Value:", max_value))
Log in or sign up to run or submit your code.Log inSign up
Input
Vector: [3, 8, 1, 15, 6]
Expected Output
Maximum Value: 15