![]() |
VOOZH | about |
Given an equation with value a, b, and c, where a and b is any value and c is constant, find how many solutions thus this quadratic equation have?
Examples:
Input : Output : 2 solutionsInput : Output : no solution
Solution:
To check whether the equation has a solution or not, quadratic formula for discriminant is used.
The formula is given as,
Respective conditions are given as,
Programs:
Output:
2 solutions
Time Complexity: O(1)
Auxiliary Space: O(1)