Compiling C Program in Linux Part 2
In the second part, we will write and compile the same program using separate headers file and program. This exercise is useful when you are teaming with your colleague or classmate working on a single project. We will also attempt to use makefile for our compilation. Writing and Compiling C Program using Multiple Programs We can convert the following program into multiple programs: #include <stdio.h> #include <math.h> double tvm (double rate, int terms, double principal); int main ( ) { double myrate; int myterm; double myprincipal; double myreturn; printf ("Please enter the following:\n"); printf ("Rate of return: "); scanf ("%lf", &myrate); printf ("\n"); printf ("Number of terms:(No decimals): "); scanf ("%d", &myterm); printf ("\n"); printf ("The principal amount: "); scanf ("%lf", &myprincipal); printf ("\n"); myreturn = tvm ...