/* * Author: D. Sheets * Description: Array loop example program */ #include int main() { int count; int array[6] = { 12, 13, 14, 22, 24, 25 }; /* Print out all elements */ for (count=0; count<6; count++) { printf("Array element %d is: %d\n", count+1, array[count]); } /* Add one to each element */ printf("Adding one to each element\n"); for (count=0; count<6; count++) { array[count] = array[count] + 1; } /* Print out all elements after they were modified */ for (count=0; count<6; count++) { printf("Array element is: %d\n", array[count]); } return(0); }