simply put all numbers in array and call max method. a=[2,3,4] a.max
On Tue, Sep 18, 2012 at 11:30 AM, Manoj M. <li...@ruby-forum.com> wrote: > Maddy wrote in post #1076411: > > Hi folks, > > > > Good day! > > > > *I want to find the largest value of given 3 values.* > > > > *Please suggest me,the simple ways of finding the largest value.* > > if a,b and c are numbers > > if(a>b) > { > if(a>c) > {("a is largest")} > else > {("c is largest")} > } > else > { > if(b>c) > {("b is largest")} > else > {("c is largest")} > } > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.