Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the library math.h has the sqrt function. Include math.h in your code. The syntax for the sqrt function is: double sqrt (double val) Also, you

image text in transcribedimage text in transcribed

the library math.h has the sqrt function. Include math.h in your code. The syntax for the sqrt function is: double sqrt (double val) Also, you can assume that a,b,c are real values. Print the solutions using %g. If there are no solutions, print the statmement "The equation has no real solutions. ". If there is only one solution, print the statement: "The only solution is X ", where X is the number. 6Type or paste question here

CH.5: (pg. 178-183) 2. filename: quadratics.c (use quadratics.out with input files quadratics_input1, quadratics_input2, quadratics_input3) In high-school algebra, you learned that the standard quadratic equation ax2 + bx+c=0 has two solutions given by the formula -b+ 32 - 4ac 2a The first solution is obtained by using + in place of ; the second is obtained by using - in place of +. Write a C program that accepts values for a, b, and c, and then calculates the two solutions. If the quantity under the square root sign is negative, the equation has no real solutions, and your program should display a message to that effect. You may assume that the value for a is nonzero. Your program should be able to duplicate the following sample run: Enter coefficients for the quadratic equation: a: 12 b:-5 - c: 62 The first solution is 3 The second solution is 2

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_2

Step: 3

blur-text-image_3

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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

Repeat Problem 1.1 for a finite core permeability of = 25000.

Answered: 1 week ago

Question

What does it mean if a bond is convertible?

Answered: 1 week ago