Ruby Program to Demonstrate the Inspect() Function

You are currently viewing Ruby Program to Demonstrate the Inspect() Function

Ruby program to demonstrate the inspect() function

# Ruby program to demonstrate 
# the inspect() function

num1 = 12;  
num2 = Complex(0,0);  
num3 = Complex(2,3);  

print "Num1: "  ,num1.inspect();
print "\nNum2: ",num2.inspect();
print "\nNum3: ",num3.inspect();
Num1: 12
Num2: (0+0i)
Num3: (2+3i)

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply