unknown wrote in post #1136598:
> Am 13.02.2014 19:29, schrieb Jaimin Pandya:
>>>>
>>>
>>
>> Is this program correct? Could you please tell me?
>
> Did you *try* whether it works?
>
> Answer: Yes (as long as the number does not have more than 10 digits).
>
> And instead of while I would use e.g. Integer#upto.
>
> Regards,
> Marcus

Yes, I tried to execute the program. Execution is possible.

I was asked because I want to know Is it correct way of programming or 
not?

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