C++ Help!?!

meggles

Active member
HELP ME! I'll give you a cookie.

I won't put the entire program in here because there's just one line that's fucking it up. I don't know how to write this in c++ form..

I have to "Write a program that reads two integers num1 and num2 from the user, then displays the total of the all

of the numbers between num1 and num2 (inclusive)."

 
Fuck tabs. Anyway I fuck up at the adding the integers up part. No clue how to do it.

here's the damn line

cout
 
like "num1+num2" instead of "num1++num2"

the ++ i think wants to add 1 to num1 and then theres no operator for num2 and i thnk thats errors
 
ahh i misread the question

you gotta loop that shit to add all the numbers up. i haven't done c++ in years so one of them other kids could probably help better. sorry im not better help, hope you get it figured out
 
carrots dont work for some reason, but what you want to do is do a while loop and make a variable equal to num1 and then increment it in the while loop and add it to a variable equal to 0, while the incremented variable is less than or equal to num2
 
Back
Top