Ruby | Integer <= method
Last Updated :
19 Mar, 2024
The <= is an inbuilt method in Ruby returns true if the number is less than or equal to the given number, else it returns false.
Syntax: num1 <= num2
Parameters: The function accepts no parameter.
Return Value: It returns true if the number is less than or equal to the given number, else it returns false.
Example 1:
num1 = 3
num2 = 3
print num1 <= num2
|
Output:
true
Example 2:
num1 = 6
num2 = 5
print num1 <= num2
|
Output:
false
Share your thoughts in the comments
Please Login to comment...