Okay, looks like a standard array. For your program, do the bubblesort like I hope is in your textbook; then you will have:
12 17 30 45 51 62
Do a for() loop, adding every other one.
Ex:
Code:int iTotal = 0, i; for(i = 0; i < 6; i += 2) iTotal += list[i]; printf("Total = %d\n", iTotal);




Reply With Quote