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. Advertisements

  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. Advertisements

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:
    456
  2. Robert Storrs

    ASP.net and traditional ASP

    Robert Storrs, Dec 11, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    1,968
    Kevin Spencer
    Dec 12, 2003
  3. Andy
    Replies:
    34
    Views:
    1,800
    Kelsey Bjarnason
    Jan 1, 2004
  4. Daniel Mark
    Replies:
    9
    Views:
    14,315
    Simon Brunning
    Sep 19, 2006
  5. pointer subtraction and sizeof

    , Jan 12, 2007, in forum: C Programming
    Replies:
    20
    Views:
    887
    Peter Nilsson
    Jan 16, 2007
  6. Replies:
    3
    Views:
    700
  7. Mohawk Mawk
    Replies:
    1
    Views:
    969
    Jukka K. Korpela
    Dec 15, 2008
  8. Brian Schröder

    NArray scalar addition and subtraction

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