C programs are composed of functions which are vaguely analogous to recipes. A function can take inputs (like ingredients) and it can produce outputs (like a cake). (Don't worry, we won't keep up this analogy for long.)
Now let's return to our "Hello World" program. It's only function was:
main() { printf( "Hello World\n" ) ; }
For now, it will suffice to notice only a few things about function definitions:
main()
. main()
, it is enough in
simple examples to just follow the name of the function (main
) with an empty
set of parentheses. Bubba Joe Bob tried to write "Hello World" this way:
Main { printf( "hello world\n" ) ; {
In what ways did he fail to produce a valid C program?
main
.print
.Answer (a) Answer (b) Answer (c) Answer (d) Answer (e) Answers (a, c, & d)