#include #include /* to compile for v7: cc math1.c gamma.c -lm note: borrowed gamma.c from unix v8 */ double sqrt(); double pow(); double gamma(); double exp(); main() { double x,y,z; double a,b,c; double d1, d2; x = 100.00; y = sqrt(x); printf ("\n%.2f is the square root of %.2f", y,x); a = 2.0; b=5.0; c=3.0; z = pow (a,b); printf ("\n%.2f to the power of %.2f equals %.2f", a,b,z); a = gamma (b+1.0); a = exp(a); printf ("\nfactorial of %.2f is %.2f\n", b, a); d1 = 2.0; d2 = 5.0; a = gamma (d2+1.0) - gamma (d1+1.0) - gamma (d2-d1+1.0); a = exp(a); printf ("\n%.0f choose %.0f is %.0f\n", d2, d1, a); }