Ruby program to initialize and print a complex number

bookmark

num = Complex(21, 18);

result = num.to_c();  

print "Complex number: ",result;

 


Output:

Complex number: 21+18i