From: brabuhr@... Date: 2009-07-28T03:45:39+09:00 Subject: Re: Help me with this program On Mon, Jul 27, 2009 at 2:07 PM, Prateek Agarwal wrote: > Woah, this is my 3rd post in like an hour. Must be really annoying for > the guys who are answering. > Well, in this program after inputting the value the program doesn't > respond or do anything. On pressing 'ctrl+c', it shows some 'interrupt' > error. > > Thanks for your help. I am still in the very basic stage of ruby. Just a general suggestion, try adding a few print statements to give you a better idea of the internal state of the code. For example: def factorial(x) puts "factorial{#{x})" . . . def power(a,b) puts "Entering power():" p a, b . . . def add(k) puts "#{Time.now}\tadd()"; p k . . . i=i+1 if (i==k) then puts sum . . . else p i end . . .