Find if two given Quadratic equations have common roots or not | Java Program to Find if two given quadratic equations have common roots or not ; Function to check if 2 quadratic equations have common roots or not . ; Driver code
class GFG { static boolean checkSolution ( float a1 , float b1 , float c1 , float a2 , float b2 , float c2 ) { return ( ( a1 / a2 ) == ( b1 / b2 ) && ( b1 / b2 ) == ( c1 / c2 ) ) ; } public static void main ( String [ ] args ) { float a1 = 1 , b1 = - 5 , c1 = 6 ; float a2 = 2 , b2 = - 10 , c2 = 12 ; if ( checkSolution ( a1 , b1 , c1 , a2 , b2 , c2 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }