How to find the Maximum of Three Numbers in R - Step by Step Examples
How to find the Maximum of Three Numbers in R ?
Answer
To find the maximum of three numbers in R, you can use the `max` function.
✐ Examples
1 Find Maximum of Three Numbers
In this example,
- We declare three variables
a
,b
, andc
with the numbers to compare. - We use the `max` function to compare the numbers and get the maximum.
R Program
a <- 5
b <- 8
c <- 3
max_val <- max(a, b, c)
print(paste('Maximum of three numbers is:', max_val))
Output
[1] "Maximum of three numbers is: 8"
Summary
In this tutorial, we learned How to find the Maximum of Three Numbers in R language with well detailed examples.