Thread: Help

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Help

    How can you add numbers without using a formula in C++. Like adding 1+2=3 then 3+3=6 all the way up to 5,000,000

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    With a loop.
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    4
    I know you would have to use a while or a for loop. what would it look like if i used a while loop

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    You are perhaps misunderstanding how things work around here. You prove you've made an attempt (post code or pseudocode) and then we help with your mistakes.
    We do not just blatantly give out code solutions.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed