int oddnumers[20];
int arrayIndex =0;
// this should fill the array with the needed information.
for(int nCount =1; nCount < 101; nCount++)
{
if(nCount % 2 != 0)
{
oddnumbers[arrayIndex] = nCount;
arrayIndex++;
if(arrayIndex > 19) break;
}
}
// with the array filled we sum the array.
int sum = 0;
for(int nIndex = 0; nIndex < 20, nIndex++)
{
sum+=oddnumbers[nIndex];
}
cout << "the sum of odds is " << sum << endl;
Printing the array should be pretty easy from the snippets I gave. I did not put these in functions they are only code snippets. The logic puts the last number in the array near 50 with every ten number you should get 5 odd numbers. You would overrun the array with getting every odd number between 1-100.
I am not going to finish the project for you but hopefully I pointed the logic in the right direction.