## Ruby Program to Read an Integer Number From the User

Ruby program to read an integer number from the user # Ruby program to read an integer # number from the user print "Enter number: " num = gets.chomp.to_i print…

## Ruby Program to Demonstrate the Logical Operators

Ruby program to demonstrate the logical operators # Ruby program to demonstrate # the logical operators num1 = 5 num2 = 2 puts("Logical AND: ",num1==5 && num2==2) puts("Logical OR :…

## Ruby Program to Demonstrate the Arithmetic Operators

Ruby program to demonstrate the arithmetic operators # Ruby program to demonstrate the # arithmetic operators num1 = 5 num2 = 2 num3 = num1 + num2 puts("Addition: ",num3) num3…

## Ruby Program to Get the Numerator From a Rational Number

Ruby program to get the numerator from a rational number # Ruby program to get the numerator # from a rational number num1 = Rational(21, 7); num2 = Rational(-7, 20);…

## Ruby Program to Check the Given Number Is an Odd Number Using Library Function

Ruby program to check the given number is an odd number using library function # Ruby program to check given number is an # odd number using library function num1…

## Ruby Program to Demonstrate the Arg() Function

Ruby program to demonstrate the arg() function # Ruby program to demonstrate # the arg() function num1 = 10; num2 = -10; print num1.arg(),"\n"; print num2.arg(),"\n"; 0 3.141592653589793

## Ruby Program to Get the Predecessor of an Integer Number Using Library Function

Ruby program to get the predecessor of an integer number using library function # Ruby program to get the predecessor of an # integer number using library function num1 =…

## Ruby Program to Get the Successor of an Integer Number Using Library Function

Ruby program to get the successor of an integer number using library function # Ruby program to get the successor of an # integer number using library function num1 =…

## Ruby Program to Get the Denominator From a Rational Number

Ruby program to get the denominator from a rational number # Ruby program to get the denominator # from a rational number num1 = Rational(21, 7); num2 = Rational(-7, 20);…

## Ruby Program to Demonstrate the Coerce() Function

Ruby program to demonstrate the coerce() function # Ruby program to demonstrate # the coerce() function num1 = 10.23; num2 = 20.24; arr = num1.coerce(num2); print "Returned array: ",arr; Returned…