Ruby program to get the division and remainder using library function

bookmark


num1 = 20
num2 = 3

print "Division and Remainder: ",num1.divmod(num2),"\n";

 


Output:

Division and Remainder: [6, 2]