Check whether two straight lines are parallel or not | C ++ program for the above approach ; Function to check if two lines are parallel or not ; If slopes are equal ; Driver Code ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; void parallel ( float a1 , float b1 , float c1 , float a2 , float b2 , float c2 ) { if ( ( - ( a1 / b1 ) ) == ( - ( a2 / b2 ) ) ) { cout << " Yes " ; } else { cout << " No " ; } } int main ( ) { float a1 = -2 , b1 = 4 , c1 = 5 ; float a2 = -6 , b2 = 12 , c2 = 6 ; parallel ( a1 , b1 , c1 , a2 , b2 , c2 ) ; return 0 ; }