First I done program like Write a program using Ruby and Print 1 to 10.
This program

I solved as follow:

x = 0
while x <= 10
  puts x
  x = x + 1
  end

Now I want to do another program. I give program statement as follow.

My program statement is Write a program using Ruby ask a number, and
Print 1 up to number.

I solved this program by following :

    x = 0
    while x <= 10
       if x.class == Fixnum
        puts x
        end
       x = x + 1
       end

But this solution of program is wrong.

So How to solve this program? Please help me on this.

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