From: brabuhr@... Date: 2009-07-26T05:38:56+09:00 Subject: Re: Please debug this program On Sat, Jul 25, 2009 at 4:02 PM, Prateek Agarwal wrote: > I had to make a program to estimate the value of pi using Ramanujan's > method. > > I have made the program but it is giving the following error > > Question1.rb:8:in 'factorial':Interrupt > > where 'factorial' is the name of the method and Question1.rb is the file > name. Try this snippet, do you see the problem here? def add(k) i = 0 loop { i += 1 if (i == k) then return i else p i, k end sleep 1 } end k = gets p add(k)