Using Strings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EVEI
    New Member
    • Oct 2008
    • 1

    Using Strings

    I Am Being Asked To Write A Program Using C++ That Would Do The Following Multiplication Using Addition With The Use Of Strings 89542*321can I Please Get Some Clues On How To Do It .we Were Given That 5*3=5+5+5 Or 3+3+3+3+3
  • curiously enough
    New Member
    • Aug 2008
    • 79

    #2
    Please clarify your question. What do you mean by "With The Use Of Strings"?

    Comment

    • whodgson
      Contributor
      • Jan 2007
      • 542

      #3
      Use a for loop with the small integer as the condition. ie i<351;
      In the body of loop k+=k;//where k=bignumber
      Not sure what you mean about strings.

      Comment

      • curiously enough
        New Member
        • Aug 2008
        • 79

        #4
        Originally posted by whodgson
        Use a for loop with the small integer as the condition. ie i<351;
        In the body of loop k+=k;//where k=bignumber
        Not sure what you mean about strings.
        Actually it's k+=a where a is a constant and is one of the two numbers to be multiplied. k+=k is equivalent to the geometric sequence U(n+1)=Un*2, not to multiplication( which I assume is what this guy might be asking for).

        Comment

        • whodgson
          Contributor
          • Jan 2007
          • 542

          #5
          Yep sum+=k where k=89542in a loop with an end condition of i<351; is a better way of expressing it

          Comment

          Working...