A Program Without Output Doesn't Do Much
One of the important characteristics of algorithms is that they
must have at least one output.
So we'll begin looking at what can be done by C programs by looking
at how we can produce output.
In our "Hello World" program, the statement that produces output is
The first thing to note is that
is a function.
(We first looked at those in
Even this simple example illustrates a number of things about using
To get the function to do something for us, we need to
If inside of a function, we have a function name followed by
parentheses (empty or not), then it calls the function.
(Notice that the function we're calling may actually be the one we're
and we'll talk about that
We might have stuff inside the parentheses.
Such things are called arguments or parameters.
We'll see about them
The first argument to printf is something that's actually printed
out on the screen.
We can include special characters in these literal strings like
which means to put a
into the output.
Putting it at the end of the output like this makes any output that
follows appear on the next line.
We normally end a
with a semicolon.