Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function
, that determines whether the value of "b squared" – 4ac is negative. If negative, the code prints out the message "no real solutions" and returns from the function.void check(double a, double b, double c){ if(a==0)cout<<"no solution for a=0";return; }
To check if "b squared" – 4ac is negative, we use the expression if ((b*b - 4*a*c)<0). This expression evaluates the 'bsquared'and substracts '4ac' from it. It then compares the resulting value with zero. if it is less than zero it means it is a negative number, so it executes the statement following cout << "no real solutions"; and returns