1. printf("%i", findValue(arr, 15, 7)); -- or -- int size = 15; int target = 7; int result; result = findValue(arr, size, target); printf("%i", result); NOTE: in the second solution, the variables "size" and "target" weren't necessary; you could have put in "15" and "7" directly. 2. There are actually several ways to do this, but we only talked about one way in class. Full points were given for any of the solutions below. 1/ int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; 2/ int arr[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; 3/ int arr[10]; int k; for (k = 0; k < 10; k++) { arr[k] = k+1; } 4/ int arr[10]; int k, v = 1; for (k = 0; k < 10; k++) { arr[k] = v; v = v + 1; } 5/ int arr[10]; arr[0] = 1; arr[1] = 2; arr[2] = 3; arr[3] = 4; arr[4] = 5; arr[5] = 6; arr[6] = 7; arr[7] = 8; arr[8] = 9; arr[9] = 10; NOTE: Solutions 1/ and 2/ use an "initializer list"; obviously this can be very useful in cases like this!! NOTE: With solutions 3/ - 5/, be careful with zero-based indexing!! The index of the first element is 0, and it needs to get the value of 1. The index of the last element is 9, and it needs to get a value of 10. 3. ----------------------------------------------------------- | | | #ifndef UTILS_H | | #define UTILS_H | | | | | | double findMax(double, int); | | double sinc(double); | | char * strcmp(char *, char *); | | | | | | #endif | ----------------------------------------------------------- NOTE: you didn't have to use "UTILS_H" as your defined symbol; however, what you chose could not have a dot (".") or be surrounded by brackets or quotation marks. It's just a symbol, and should be chosen to minimize the chances of conflicting with symbols from other parts of the program -- normally the name of the header file is used, but all-caps and with an underscore instead of a dot. 4. FALSE 5. (d) NOTE: (a) is wrong because it doesn't give a return type, and puts the square brackets in the wrong place (they should be after the variable name). NOTE: (b) is wrong because it specifies "double" as a return type instead of "void", and doesn't have the first parameter in place. NOTE: (c) is wrong because it doesn't give types for the two parameters. Since these are *formal* parameters, the types are required.