#include #include //define the functions here (simply copy the first line of your function) int doSubtraction(int a, int b); float getSlope(int x, int y, int x2, int y2); void main() { float slope; int difference; printf("main function\n"); slope = getSlope(2, 5, 4, 10); difference = doSubtraction(1, 2); printf("difference = %d\n", difference); printf("slope = %f\n", slope); system("pause"); } /*function name suggests the purpose of the function. *int at the beginning means the result of using the function should be an integer *int a and int b define the arguments to the function; you may guess the function * computes the difference between a and b */ int doSubtraction(int a, int b) { return a-b; //returning an integer } /* function name suggests the purpose of the function. * float at the beginning means the result of using this function should be a float * int x, int y, int x2, int y2 define the arguments to the function * note: the result of calling a function is usually based on these arguments * This function will compute the slope between two points */ float getSlope(int x, int y, int x2, int y2) { int difference; //you can call functions from other functions //difference = doSubtraction(2, 3); float result = (1.0*x2-x)/(1.0*y2-y); return result; }