Next: Complete Program, Previous: Top, Up: Top [Contents][Index]
This chapter presents the source code for a very simple C program and uses it to explain a few features of the language. If you already know the basic points of C presented in this chapter, you can skim it or skip it.
We present examples of C source code (other than comments) using a fixed-width typeface, since that’s the way they look when you edit them in an editor such as GNU Emacs.
• Recursive Fibonacci | Writing a simple function recursively. | |
• Stack | Each function call uses space in the stack. | |
• Iterative Fibonacci | Writing the same function iteratively. |