#include <stdio.h> #include <math.h> double f(double T2) /* Double T2 is used for improved precision of T2 */ { double q = 750; /* Rate at which the blackened surface absorbs the solar energy */ double T3 = 303.15; /* Temperature in Kelvin at which the outside surface of the glass loses energy to the environment */ double h = 20; /* Unidentified constant given */ double E = 0.9; /* The epsilon constant given */ double S = 5.669E-8; /* Sigma constant given */ double dX = .075; /* Delta X converted from centimeters to meters */ double k = 0.042; /* Effective air thermal conductivity */ return h*(T2-T3)+(E*S)*((T2*T2*T2*T2)-(T3*T3*T3*T3))-q; /* Non-linear equation in which we are solving for T2 */ } double SecantMethod(double T2n_1, double T2n, double e, int m) { int n; double d; for (n = 1; n <= m; n++) { d = (T2n - T2n_1) / (f(T2n) - f(T2n_1)) * f(T2n); if (fabs(d) < e) return T2n; T2n_1 = T2n; T2n = T2n - d; } return T2n; } int main(void) { printf("%0.10f\n", SecantMethod(0, 1, 5E-11, 1000)); return 0; } :D double f(double J2O) /* Double J2O is used for improved precision of J2O */ { double T2n; double q = 750; /* Rate at which the blackened surface absorbs the solar energy */ double T3 = 303.15; /* Temperature in Kelvin at which the outside surface of the glass loses energy to the environment */ double h = 20; /* Unidentified constant given */ double E = 0.9; /* The epsilon constant given */ double S = 5.669E-8; /* Sigma constant given */ double dX = .075; /* Delta X converted from centimeters to meters */ double k = 0.042; /* Effective air thermal conductivity */ return ((E/(1-E))*(S*(T2n*T2n*T2n*T2n)-J2O))-((E*S)*((T2n*T2n*T2n*T2n)-(T3*T3*T3*T3))); } double SecantMethod(double J2On_1, double J2On, double e, int m) { int n; double d; for (n = 1; n <= m; n++) { d = (J2On - J2On_1) / (f(J2On) - f(J2On_1)) * f(J2On); if (fabs(d) < e) return J2On; J2On_1 = J2On; J2On = J2On - d; } return J2On; } }

I had used the int main to solve for the frst function, but i know if i add more functions, the int main must be moved. I need to find J20 for this second equation which contains T2 which was found in the original equation. Can anybody help me?