#include <stdio.h> int plus(int a, int b); int minus(int a, int b); int multiply(int a, int b); int divide(int a, int b);
#include "calculate.h" int plus(int a, int b) { int c = a + b; return c; } int minus(int a, int b) { int c = a - b; return c; } int multiply(int a, int b) { int c = a * b; return c; } int divide(int a, int b) { int c = a / b; return c; }
#include "calculate.h" int main(int argc, char** argv) { int a = 20; int b = 10; int c = plus(a, b); printf("%d ", c); c = minus(a, b); printf("%d ", c); c = multiply(a, b); printf("%d ", c); c = divide(a, b); printf("%d ", c); return 0; }
gcc -Wall main.c calculate.c -o main.o