CIS 71: Some Simple C Programs
The Hello program
Computing powers of 2
Printing Large Block Letters
Adding two integers
Adding n integers
Adding a sequence of positive integers
Finding the value of a collection of coins
Computing the factorial of a number
Determining if a number is a prime
Finding all the proper factors of a number
What are in C the values of TRUE and FALSE?
Computing Fibonacci numbers
Some simple functions
More simple functions
Simple example on scope rules
Another example on scope rules
Operations on arrays
Simple uses of arrays
Reading, writing, reversing an integer array
Various C features: __DATE__, sizeof, conditional expressions, ..
Addresses and values of variables
Numeric value of printable characters
A simple linear congruence random number generator
Generating random permutations
Reading lines from input and echoeing them to output
Reading an array and doing linear searches on it
Rotating an array
Primes using sieve method
Starting with strings
Reading a line from input
Compacting a string
Various counts on a text file
Copying a text file
Using enumerations
Using typedef
Reading an array and doing binary searches on it
Sorting an array of integers with Selection Sort
Sorting an array of integers with Bubble Sort
MergeSort [from CalTech]
Reading and Writing an Integer
Arrays and pointers: pointer arithmetic
Selection Sort, decomposed into multiple files
[see
discussion
]
Program outline for Homework 10
Program outline for Homework 10, decomposed
Simple uses of structures
Reading and writing to a file an array of structures
Merging sorted sequences of integers
Merging two sorted files of strings
Sorting and merging sequences of student records
A program to remove those ugly CONTROL-M s
Reading and writing to a file a list of structures
Reading and writing to a file a list of structures using a queue ADT
Create a binary file
from
a text file
and then
read from it