How do you find the general equation of cone using C language?

If you mean the "general equation of a cone" to be the elliptical cone equation:

z = √( (x/a)2 + (y/b)2 )

... then the function in C to compute this given the proper variables is:

double genEqCone(const double x, const double y, const double a, const double b) {

const double X_A = (x/a);

const double Y_B = (y/b);

return sqrt((X_A * X_A) + (Y_B * Y_B));

}