As I asked I want to do program without using array:

I am trying to do as follow:

n = 1
while n <= 5
  1.upto(n) do |i|
       print "#{i} "
      end
   n += 1
   end

So, Output display like:
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5

But I want output like as follow:
1
12
123
1234
12345

Means, Output display like horizontally (1 2) in same line, but I want 
output in second line.

How to do that?

Thank you.

-- 
Posted via http://www.ruby-forum.com/.