Exercise 2 Write a
C
program to calculate the following quadratic function.
f(x)=ax^(2)+bx+c
The constants
a,b,c
are the last three digits of your ID. For example, if your ID is A12345, then,
a=3,b=4,c=5
. Declare an int type array, and fill the array with the last three digit of your ID, Figure 4 illustrates the filled array: \table[[3,4,5]] Declare three pointers which points to each of the three array element. As Figure 5 illustrates: The following function prototype is given to calculate the quadratic function: int quadratic (int *aptr, int *bPtr, int *cPtr); Given than
x=5
. Write the function definition for the function quadratic. Calculate the quadratic function. Using only the pointers display the: a. The last three digits of your ID b. The memory location of each of the pointers Display the calculated value of the quadratic function. The program's output display must follow the format of output display shown in Figure 6 (example for ID:A12345):