R Lang

R Program to Find the greatest number among three numbers1 min read

In this program, You will learn how to find the greatest number among the three numbers in R.

R Program Example: How to find the greatest number among three numbers in R




Output:

The code first reads in values for x, y, and z from the user and stores them as integers. It then enters a series of if statements which compare the values of x, y, and z and print the largest value to the console.

The first if statement checks if x is greater than both y and z. If it is, the code prints a message saying that x is the largest. If x is not the largest, the code enters the second if statement which checks if y is greater than z. If it is, the code prints a message saying that y is the largest. If neither of these conditions are true, the code enters the else block and prints a message saying that z is the largest.

Leave a Comment