Ruby program to return multiple values from the user-defined function

Using this tutorial you will successfully complete the task of Ruby program to return multiple values from the user-defined function Let’s go

Ruby program to return multiple values from the user-defined function

Ruby program to return multiple values from the user-defined function

# Ruby program to return multiple values 
# from the user define function

def RetMultipleValues()
    return 10,20;
end

val1,val2=RetMultipleValues();
print "Value1 is: ",val1,"\n";
print "Value2 is: ",val2,"\n";
Value1 is: 10
Value2 is: 20

Final Words

We hope you find the Ruby program to return multiple values from the user-defined function. What to do if there are any issues with this article? Then ask through the comment section.

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

Share on:

Leave a Comment