# To change this template, choose Tools | Templates
# and open the template in the editor.
puts "Hello World"
def squareroot(a)
u=a
l=0
while (l<=u)
m = l + (u-1)/2
if (m**2) < a
l = m + 1
elsif (m**2) > a
u = m-1
elsif
m**2 == a
return m
else
return l-1
end
end
end
x = squareroot(55)
print x
Rahul
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.