Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c program Lab Exercise 5 ENGR 1213L Engineering Computing Lab Selection Structur

ID: 3585877 • Letter: C

Question



c program

Lab Exercise 5 ENGR 1213L Engineering Computing Lab Selection Structures you will be expected to turn in your programs to an online dropboxon D2L Name: f you are working on a laptop, you need to begin the lab by making sure the laptop is logged onto the selection structure to direct the behavior of the program. Procedure Begin by opening a file in nano titled Lab5.c This program is going to discern between different cases that can result from the quadratic formula, and will display different resuits depending on if the formula returns real, imaginary, or no roots. This program will be making use of the square root function as well as printf and scanf statements, so include the appropriate c libraries Problem description: When a 2 order polynormial is arranged in the following form: This is described as a quadratic equation in standard form. The quadratic equation can be solved for all possible inputs by applying the mathematical technique of "completing the square" and then solving for when this is done, the resulting formula is what is commonly referred to as the quadratic formula: Za Our end goal with this program is to write a program that takes in the three coefficients, A, B, And C then computes and displays the solutions to the quadratic equation. Depending on the values of the coefficients, there are three possibilities If A is zero, the denominator of the QF is equal to zero, which means the formula cannot be applied to that problem f B is zero, the solutions to the fomula are purely imaginary. (which means they consist of a number multiplied by the square root of -1, represented by the letter L tvtac la

Explanation / Answer

#include #include #include void main() { int a,b,c; float x1,x2,d; printf(" Enter the value of a,b.c:"); scanf("%d%d%d",&a,&b,&c); d=(b*b)-(4*a*c); if(d==0) { x1=x2=(b*b)-(4*a*c); } if(d==0) { x1 =x2=(-b)/(2*a); printf(" Roots are equal, they are x1=%f and x2=%f",x1,x2); } if(d0) { x1=((-b)+sqrt(d))/(2*a); x2=((-b)-sqrt(d))/(2*a); printf(" Roots are"); printf(" x1=%f",x1); printf(" x2=%f",x2); } getch(); }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote