- Mar 30, 2016 C TUTORIAL -19- Exercise Finding the roots of. Find the root of a quadratic equation in c programming. Program to find roots of quadratic equation in C language (Hindi.
- Feb 13, 2011 Write a C program that solves quadratic equation to find its roots. The roots of a quadratic equation ax2+bx+c=0 (where a is not zero) is given by the formula: x=(-b±√(b^2-4ac))/2a Note:To find the square root of a number, use the function sqrt and include the math library. Where (b^2-4ac) is the discriminant.
Below is direct formula for finding roots of quadratic equation. There are following important cases. If b.b 4.a.c, then roots are real and different. Download traktor pro 3.
I am supposed to write a program that asks for the coefficients a, b, and c of a quadratic equation ax2+bx+c=0. It needs to display to the screen one of the following:
• two distinct real numbers (when b2-4ac > 0),
• two distinct complex numbers (when b2-4ac < 0), or
• one real number (when b2-4ac = 0)
• two distinct real numbers (when b2-4ac > 0),
• two distinct complex numbers (when b2-4ac < 0), or
• one real number (when b2-4ac = 0)
I have worked the following program and it doesn't work when set up this way:
What is the latest version of traktor pro 2. If I change the last statement to 'if else' the program works, but I don't think that would be correct. Please help.
Edited by WaltP: Added CODE tags -- with all the help about them, how could you miss using them????
- 3 Contributors
- forum 4 Replies
- 827 Views
- 7 Hours Discussion Span
- commentLatest Postby abhimanipalLatest Post
Dave Sinkula2,398
I am supposed to write a program that asks for the coefficients a, b, and c of a quadratic equation ax2+bx+c=0. It needs to display to the screen one of the following:
• two distinct real numbers (when b2-4ac > 0),
• two distinct complex numbers (when b2-4ac < 0), or
• one real number (when b2-4ac = 0) Little snitch releases.
• two distinct real numbers (when b2-4ac > 0),
• two distinct complex numbers (when b2-4ac < 0), or
• one real number (when b2-4ac = 0) Little snitch releases.
I have worked the following program and it doesn't work when set up this way:
If I change the last statement to 'if else' the program works, but I don't think that would be correct. Please help.
Dev C Quadratic Equation Model
It's a syntax error as written, and won't compile, so it can't be run. Why would you think this is more correct?
You're also not declaring a, b, and c. Please post actual code and wrap it in code tags. C/o vitamins.
It would be less redundant to use a temporary, say
Dev C++ Quadratic Equation Calculator
instead of recalculating it several times. It is also cleaner, clearer, and easier to read.