Well you had a few minor hiccups but this should help you out. Keep in mind that you need to initialize any variables before you attempt to use them in a calculation. You also tried using modulus on "number" when you should be testing "count".
cpp
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int number;
int numint;
// Initialize variables before using in equations.
int sumeven = 0;
int sumodd = 0;
int count =1;
cout<<"Enter number of integers "<<endl;
cin>> numint;
cout<<"Enter number"<<endl;
cin>>number;
// You are going to mod the counter not number
// counter represents the current count
while ( count < number )
{
switch (count % 2)
{
case 0:
sumeven = sumeven + count;
break;
case 1:
sumodd = sumodd + count;
break;
}
// Increment count here, since both cases need to increment
// cut it out and place it at the end of the loop
count++;
}
cout<<"The even numbers are "<<sumeven<<endl;
cout<<"The odd numbers are "<<sumodd<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Read the in-code comments to see how this is done using your code. Also keep in mind that since count < number it will not count the last number in the sum. You have to do <= if you want to include the last number.
So for instance if you type in 10, it will read even as 20 and not even as 30 because it didn't add in "10".
Enjoy!
"At DIC we be integer summing code ninjas... we also "summon" things like giant marshmallow men to destroy NYC!"