QUOTE(Sadaiy @ 3 Oct, 2008 - 03:45 PM)

i think if you are using a loop to do this with a counter then you need to use an array like so:
CODE
#include <iostream>
using namespace std;
const int X = 5;
int main()
{
int num[5];
int sumEven = 0, sumOdd = 0;
cout << "Please enter 5 integers" << endl;
for(int counter = 0; counter < X; ++counter)
{
cin >> num[counter];
}
cout << "The numbers you entered are: " << endl;
for(int counter = 0; counter < X; ++counter)
{
cout << num[counter] << " ";
}
for(int counter = 0; counter < X; ++counter)
{
if(num[counter] % 2 == 0)
sumEven += num[counter];
else
sumOdd += num[counter];
}
cout << "The sum of the even numbers is: " << sumEven << endl;
cout << "The sum of the odd numbers is: " << sumOdd << endl;
return 0;
}
ok so would I take out the case and make it into an array or do I incorporate into my program and place it where my case statement is?