1. ## something really simple....

This is supposed to be an easy one, but I can't get it to work right..

------------------------------------
Code:
```---------------------------------
int main ()
{
int num1, num2;
float sum, average;
num1=0; num2=0;
sum = num1 + num2;
average = (num1 + num2) / 2.0;
cout << "This program calculates the sum and average of two input integers." << endl;
cout << "Please enter two integers separated by a space: ";
cin >> num1 ; num2;
cout << endl;

// Add num1 + num2 for the sum.
sum = num1 + num2;

// Average of num1 and num2.
average = (num1 + num2) / 2.0;

// Display the sum of num1 + num2.
cout << "The sum of your two numbers is " << sum << endl;

// Display the average of num1 and num2.
cout << "The average of your two numbers is " << average << endl << endl;

return 0;
}```

2. ## Re: something really simple....

Code:
```int main ()
{
int num1, num2;
float sum, average;
num1=0; num2=0;
sum = num1 + num2;                    //These two lines are
average = (num1 + num2) / 2.0;   //doing nothing valuable.
cout << "This program calculates the sum and average of two input integers." << endl;
cout << "Please enter two integers separated by a space: ";
cin >> num1 ; num2;  // Here's your biggest problem.
//Change that line to cin >> num1 >> num2;
cout << endl;

// Add num1 + num2 for the sum.
sum = num1 + num2;

// Average of num1 and num2.
average = (num1 + num2) / 2.0; //It'd be better to use your sum variable rather that do the same computation twice.

// Display the sum of num1 + num2.
cout << "The sum of your two numbers is " << sum << endl;

// Display the average of num1 and num2.
cout << "The average of your two numbers is " << average << endl << endl;

return 0;
}```
That ought to fix everything necessary. Also, sum could be an int. And when you open a tag like code, you need to close it with [ /code ], except without those spaces.

3. //edit: he (joshdick) was posting at the same time as me -_-

you forgot the closing code tag
Code:
```#include <iostream>
using namespace std;

int main ()
{
int num1, num2;
float sum, average;
num1=0; num2=0;

sum = num1 + num2; //not necessary
average = (num1 + num2) / 2.0;//not necessary

cout << "This program calculates the sum and average of two input integers." << endl;
cout << "Please enter two integers separated by a space: ";
cin >> num1 >> num2;
cout << endl;

// Add num1 + num2 for the sum.
sum = num1 + num2;

// Average of num1 and num2.
average = (num1 + num2) / 2.0; //if this doesn't work (it should), try average=static_cast<float>(num1+num2)/2.0;

// Display the sum of num1 + num2.
cout << "The sum of your two numbers is " << sum << endl;

// Display the average of num1 and num2.
cout << "The average of your two numbers is " << average << endl << endl;

return 0;
}```

4. Thank you major small & joshdick - I was able to get it to work with your guys help!

Also thanks for the [/code]
It's only my second post (I'm obviously VERY new to C++)
and I did read the message about posting code, but forgot the closing code.

Thanks!!!

5. no problem... i often forget teh closing tag... just go back and edit the post...

6. Glad I could help. I'm also glad that I got to this post first. It's the small things in life that make me happy

7. i'm always worried that that will happen... i do all that work, then somebody like you comes along and posts before i get a chance -_- j/k... it wasn't much work, really

8. I'm usually worried about that too, which is why I do my best to post quickly.

9. Wow! If you guys are really eager to help I have a few more problems to work on.