Quadratic Formula in C language
Remember the famous quadratic formula? Let's learn today, how we can implement it in c language. First, we'll take variables a, b and c for the quadratic formula values. Pos and Neg variable for negative and postive value of quadratic formula. Then, we'll take the values of a,b, and c as input from the user. After that, we'll calculate '4' into 'a' into 'c' i.e (4 * a * c) and save the answer in d variable and apply the condition value of d is greater than 0 than continue, else show complex roots. In if condition we'll apply the formula to calculate the value of quadratic value. and save the answer in their respective variable. After that, we'll print the answers. Related: Marksheet in C. How to Return Multiple Values from a function . Calculator in C Using If-Else .