Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2 Write a C program to calculate the following quadratic function. f ( x ) = a x 2 + b x + c

Exercise 2
Write a C program to calculate the following quadratic function.
f(x)=ax2+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):
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

1. Diagnose and solve a transfer of training problem.

Answered: 1 week ago