The < is an inbuilt method in Ruby returns true if the number is less than 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 the given number, else it returns false.
Example 1:
num1 = 2
num2 = 3
print num1 < num2
|
Output:
true
Example 2:
num1 = 6
num2 = 5
print num1 < num2
|
Output:
false
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
06 Jan, 2020
Like Article
Save Article