Skip to content
Related Articles

Related Articles

Ruby | Integer > method
  • Last Updated : 06 Jan, 2020

The > is an inbuilt method in Ruby returns true if the number is greater 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 greater than the given number, else it returns false.

Example 1:






# Ruby program for > method in Integer 
    
# Initialize numbers 
num1 = 6
num2 = 3 
  
# Prints greater or not
print num1 > num2

Output:

true

Example 2:




# Ruby program for > method in Integer 
    
# Initialize numbers 
num1 = 3
num2 = 5
  
# Prints greater or not 
print num1 > num2

Output:

false

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :