C Program Statements
In the last lesson you started to study a program written in C. You looked
at the program, compiled and ran it, and learned about its overall structure.
In this lesson we will look at the program more closely and talk about its
individual statements. At the end of today's lesson you should know enough
C to be able to write your own, all-new programs.
Before we begin, you'll need to have a copy of the program ``joints.c''
from the previous lesson. Hopefully this program is already in your
examples directory (i.e., the directory named examples inside your home
directory). But if for some reason you need a new copy of the program, click
on the button below.
Click to copy the example files.
Use Emacs to view ``joints.c''.
You can also view the program as
joints.c.
Remember from the previous lesson that the program solves a kinematics problem
pertaining to a sports training exercise called the ``squat.'' In particular,
the programs determine the X and Y coordinate position of the squatter's knee
joint.
Let's go through the program and look at the actual instructions--program
statements--that make it up.
Eric N. Eide
Hamlet Project
Department of Computer Science
University of Utah