Find if two given Quadratic equations have common roots or not | C ++ 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
#include <iostream> NEW_LINE using namespace std ; bool checkSolution ( float a1 , float b1 , float c1 , float a2 , float b2 , float c2 ) { return ( a1 / a2 ) == ( b1 / b2 ) && ( b1 / b2 ) == ( c1 / c2 ) ; } int main ( ) { float a1 = 1 , b1 = -5 , c1 = 6 ; float a2 = 2 , b2 = -10 , c2 = 12 ; if ( checkSolution ( a1 , b1 , c1 , a2 , b2 , c2 ) ) cout << " Yes " ; else cout << " No " ; return 0 ; }