Question: Write C code that does the following: 1 . Interactively read the three coefficients of a quadratic equation and compute the two roots. Read a

Write C code that does the following:1. Interactively read the three coefficients of a quadratic equation and compute the two roots. Read a, b, c of

a x2 + b x + c = 0,

and compute

x =
b

b2 4 a c

2 a
.

Note: sqrt is available in math.h. You need to compile the program with "-lm" option, i.e.

gcc -lm myprogram.c 

Make sure that you add a routine to check the positiveness of the discriminant using the if statement. Show actual runs and examples.2. Interactively read temperature in Celsius and convert it to Fahrenheit. Note

C = (F 32 ) 59 .

Example:

$ a.out Enter temperature in C = 29 It is 84.2 degrees in Fahrenheit. 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!