your question is not clear please make ot clearer...what do u mean the sum of odd and integer you mean all odd numbers are added together and all even numbers added together...plus from where you need to read the number?? however i can help by a small stuff if that what you mean: Code: void main() { int a[5]; int evensum=0; int oddsum=0; a[0]=7; a[1]=1; a[2]= 3; a[3]= 2; a[4]= 6; for(int i=0; i<6; i++) { if(a[i]%2==0)//means its even { evensum += a[i]; //then add this to the int evensum } else { oddsum += a[i]; } } hope that was your point