The / is an inbuilt method in Ruby returns the division of two numbers. It returns num1 / num2.
Syntax: num1 / num2
Parameters: The function accepts no parameter.
Return Value: It returns the division of two numbers.
Example 1:
num1 = 16
num2 = 4
print num1 / num2
|
Output:
4
Example 2:
num1 = 21
num2 = 3
print num1 / num2
|
Output:
7
Last Updated :
19 Mar, 2024
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...