[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Traditional Addition and Subtraction

Zunaster

1/30/2007 12:19:00 PM

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


1 Answer

Harry

3/1/2007 4:09:00 AM

0

On 1/30/07, Zunaster <zunaira.sohag@gmail.com> 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/Learn...

Harry

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