Generate Quadratic Equation having given sum and product of roots | Java program for the above approach ; Function to find the quadratic equation from the given sum and products of roots ; Print the coefficients ; Driver code
import java . io . * ; class GFG { public static void findEquation ( int S , int M ) { System . out . println ( "1 ▁ " + ( ( - 1 ) * S ) + " ▁ " + M ) ; } public static void main ( String [ ] args ) { int S = 5 , M = 6 ; findEquation ( S , M ) ; } }