Help

This is a discussion on Help within the C++ Programming forums, part of the General Programming Boards category; How can you add numbers without using a formula in C++. Like adding 1+2=3 then 3+3=6 all the way up ...

  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
    Katy, Texas
    Posts
    2,309
    With a loop.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  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,288
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21