/* * Lab two, CSC 180, Fall 2001 * Newton's law calculations * * This file is a generic calculation module. It is to be linked with another * file which supplies user input prompts in name1 and name2, a function * calc() which performs the applicable calculation, and descriptive text for * use in the output in name3. */ extern char name1[], name2[], name3[]; extern double calc(double x, double y); int main() { double x, y; printf("Please enter %s: ", name1); scanf("%lg", &x); printf("Please enter %s: ", name2); scanf("%lg", &y); printf("The %s is %lg\n", name3, calc(x, y)); return 0; }