Special case when slope of required line becomes infinity
if ( 1 - tan ( x ) * given_slope == 0 ) { cout << " x ▁ = ▁ " << x1 << endl ; } if ( 1 + tan ( x ) * given_slope == 0 ) { cout << " x ▁ = ▁ " << x1 << endl ; }