EXelelse 2_bugs3.c cied3 /* Solution of a*x*x + b*x + c = 0 */ #include #include int main (void) { do

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

EXelelse 2_bugs3.c cied3 /* Solution of a*x*x + b*x + c = 0 */ #include #include int main (void) { do

Post by answerhappygod »

Exelelse 2 Bugs3 C Cied3 Solution Of A X X B X C 0 Include Stdio H Include Math H Int Main Void Do 1
Exelelse 2 Bugs3 C Cied3 Solution Of A X X B X C 0 Include Stdio H Include Math H Int Main Void Do 1 (82.17 KiB) Viewed 44 times
Exelelse 2 Bugs3 C Cied3 Solution Of A X X B X C 0 Include Stdio H Include Math H Int Main Void Do 2
Exelelse 2 Bugs3 C Cied3 Solution Of A X X B X C 0 Include Stdio H Include Math H Int Main Void Do 2 (116.71 KiB) Viewed 44 times
Output
Exelelse 2 Bugs3 C Cied3 Solution Of A X X B X C 0 Include Stdio H Include Math H Int Main Void Do 3
Exelelse 2 Bugs3 C Cied3 Solution Of A X X B X C 0 Include Stdio H Include Math H Int Main Void Do 3 (33.38 KiB) Viewed 44 times
EXelelse 2_bugs3.c cied3 /* Solution of a*x*x + b*x + c = 0 */ #include <stdio.h> #include <math.h> int main (void) { double a, b, c, rooti, root2; printf("Input the coefficient a=> "); scanf("%1f", &a); printf ("Input the coefficient b=> "); scanf("%1f", &b); printf("Input the coefficient c=> "); scanf("%1f", &C); /*Compute the roots. */ root1=(-b+ sqrt (b*b-4*a*c))/(2*a); root2 = (-b- sqrt (b*b-4*a*c))/(2*a) ; = printf("The first root is %8.3f\n", root1); printf("The second root is %8.3f\n", root2); return 0; }

Suppose we input: a = 2, b = 6, C = 1 = There are 2 space characters + The remaining 6 characters are '-', '0', ', '1', '7' and '7' II Thus, there are -0.177 8 characters in -2.823 total Screen Output: The first root is The second root is

Input the coefficient a=> 2 Input the coefficient b=> 6 Input the coefficient c=> 1 The first root is -0.506 The second root is -0.506 execution time: 7.989 S Process returned o (Oxo) Press any key to continue.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply