Answer to Question method-1

double s = Math.sqrt(b*b - 4*a*c);