Discussion in 'Ruby' started by Zunaster, Jan 30, 2007.

1. ZunasterGuest

I am a newbie in programming and I am facing problem in adding and
subtracting numbers, which also involves carrying of a number. A
manner of carrying and borrowing. In this program no arrays have been
used, instead the concept of GIGO (Garbage In Garbage Out) is used for
carrying out the process. the goal is to calculate the digits in the
traditional manner, which is illustrated in the process.

If a.Length > b.Length Then
z = equallength(a, b)
TextBox2.Text = z
ElsIf b.Length > a.Length Then
z = equallength(b, a)
print z

Zunaster, Jan 30, 2007

2. HarryGuest

On 1/30/07, Zunaster <> wrote:
> I am a newbie in programming and I am facing problem in adding and
> subtracting numbers, which also involves carrying of a number. A
> program to add , subtract and multiply digits in the traditional
> manner of carrying and borrowing. In this program no arrays have been
> used, instead the concept of GIGO (Garbage In Garbage Out) is used for
> carrying out the process. the goal is to calculate the digits in the
> traditional manner, which is illustrated in the process.
>
> If a.Length > b.Length Then
> z = equallength(a, b)
> TextBox2.Text = z
> ElsIf b.Length > a.Length Then
> z = equallength(b, a)
> print z
>
>

If you are new to programming, you may want to take a look at this.
http://pine.fm/LearnToProgram/

Harry

--
http://www.kakueki.com/ruby/list.html
Japanese Ruby List Subjects in English

Harry, Mar 1, 2007