#include int numroots ( double p, double q, double r ) { double d = q*q - 4*p*r; if ( d<0 ) { return 0; } else if ( d==0 ) { return 1; } else { return 2; } } int main () { double a,b,c; int num; printf("Enter the coefficients: "); scanf("%lf %lf %lf", &a, &b, &c); num = numroots(a, b, c); printf( "Number of roots: %i\n", num ); return 0; }