The == is an inbuilt method in Ruby returns true if both numbers are equal, else it returns false
Syntax: num1 == num2
Parameters: The function accepts no parameter.
Return Value: It returns true if both numbers are equal, else it returns false
Example 1:
num1 = 2
num2 = 3
print num1 == num2
|
Output:
false
Example 2:
num1 = 5
num2 = 5
print num1 == num2
|
Output:
true
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