Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Traditional Addition and Subtraction

Reply
Thread Tools

Traditional Addition and Subtraction

 
 
Zunaster
Guest
Posts: n/a
 
      01-30-2007
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


 
Reply With Quote
 
 
 
 
Harry
Guest
Posts: n/a
 
      03-01-2007
On 1/30/07, Zunaster <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array index subtraction and wrapping wearyofallthiscrap@gmail.com C Programming 3 06-27-2007 10:15 PM
pointer subtraction and sizeof junky_fellow@yahoo.co.in C Programming 20 01-16-2007 10:21 PM
How to efficiently proceed addition and subtraction in python list? Daniel Mark Python 9 09-19-2006 01:16 PM
NArray scalar addition and subtraction Brian Schröder Ruby 1 11-28-2004 08:03 PM
unsigned short addition/subtraction overflow Andy C Programming 34 01-01-2004 01:57 AM



Advertisments