Skip to content
Related Articles
Open in App
Not now

Related Articles

Ruby | Integer / method

Improve Article
Save Article
  • Last Updated : 06 Jan, 2020
Improve Article
Save Article

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:




# Ruby program for / method in Integer 
    
# Initialize numbers 
num1 = 16
num2 = 4 
  
# Prints division
print num1 / num2

Output:

4

Example 2:




# Ruby program for / method in Integer 
    
# Initialize numbers 
num1 = 21
num2 = 3 
  
# Prints division
print num1 / num2

Output:

7
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!