C Programming Examples
All these examples have been tested on a PC running Linux and using
the 'gcc' compiler. You can extract the programs with the 'save' option
under 'file' and compile with your own compiler.
- 
 
- 
Your first C program.
- 
 
- 
if.
- 
 
- 
while.
- 
 
- 
do.
- 
 
- 
for example 1.
for A more advanced example.
- 
 
- 
switch.
- 
 
- 
function.
- 
 
- 
Global and local variables.
- 
 
- 
Increment & decrement.
- 
 
- 
Pass command line arguments.
- 
 
- 
Print from 10 to 1 - three examples.
- 
 
- 
Read a file - version 1.
- 
 
- 
manipulate strings.
- 
 
- 
Using 'curses' to read a password.
- 
 
- 
Programs requiring X. Unix users
only. 
 
- 
 
- 
Index of all example programs.
- 
 
- 
O'Reillys' Using C examples.
- 
 
- 
O'Reillys' Practical C examples.
- 
 
- 
Bob Stouts 'Snippets'.
Martin Leslie