/* * Author: D. Sheets * Description: Using array elements as variables */ #include #define SIZE 6 void print_int(int value) { printf("Got value %d\n", value); } int get_int(void) { int value; printf("Input an integer:"); scanf("%d", &value); return(value); } int main() { int count; int array[SIZE] = { 12, 13, 14, 22, 24, 25 }; /* You can pass array elements as arguments to functions */ print_int(array[3]); /* You can set array elements to a new value, * including from a value returned from a function */ array[4] = get_int(); /* You can use array elements in conditional expressions */ if(array[4] > array[3]) { printf("You input a value %d, greater than %d\n", array[4], array[3]); } return(0); }