Traditional Addition and Subtraction

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

  1. Zunaster

    Zunaster Guest

    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
    Zunaster, Jan 30, 2007
    #1
    1. Advertising

  2. Zunaster

    Harry Guest

    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
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Thomas
    Replies:
    3
    Views:
    367
  2. Robert Storrs

    ASP.net and traditional ASP

    Robert Storrs, Dec 11, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    1,637
    Kevin Spencer
    Dec 12, 2003
  3. Andy
    Replies:
    34
    Views:
    1,354
    Kelsey Bjarnason
    Jan 1, 2004
  4. Daniel Mark
    Replies:
    9
    Views:
    12,396
    Simon Brunning
    Sep 19, 2006
  5. Brian Schröder

    NArray scalar addition and subtraction

    Brian Schröder, Nov 28, 2004, in forum: Ruby
    Replies:
    1
    Views:
    92
    Brian Schröder
    Nov 28, 2004
Loading...

Share This Page