If a is 0 , then equation is not quadratic , but linear
if ( a == 0 ) { Console . Write ( " Invalid " ) ; return ; } int d = b * b - 4 * a * c ; double sqrt_val = Math . Abs ( d ) ; if ( d > 0 ) { Console . Write ( " Roots ▁ are ▁ real ▁ and ▁ different ▁ STRNEWLINE " ) ; Console . Write ( ( double ) ( - b + sqrt_val ) / ( 2 * a ) + " STRNEWLINE " + ( double ) ( - b - sqrt_val ) / ( 2 * a ) ) ; }