Home Segments Index Top Previous Next

13: Mainline

Finally, the book develops a simple, yet realistic C program, which you see in many versions as your understanding of the language increases. In its ultimate version, the program reads data from a file containing recent stock-market information, computes the average price per share and number of shares traded, and predicts the next-day's price using a straight line fitted to previous prices. The statistical flavor of the example is meant to suggest the popularity of C as a language for implementing statistical-analysis programs.