Open In App
Related Articles

Ruby | Integer < method

Improve Article
Improve
Save Article
Save
Like Article
Like

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:




# Ruby program for < method in Integer 
    
# Initialize numbers 
num1 = 2
num2 = 3 
  
# Prints equal or not 
print num1 < num2


Output:

true

Example 2:




# Ruby program for < method in Integer 
    
# Initialize numbers 
num1 = 6
num2 = 5
  
# Prints equal or not 
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
Previous
Next
Similar Reads