Programs for ECS 30 Fall 2015
bufov.c (buffer overflow example)
calc.c (simple calculator)
cat1.c (cat version 1)
cat2.c (cat the file “cat2.c”)
change.c (make change)
charcount.c (count characters in a file)
echo.c (echo command-line arguments)
echo2.c (echo.c, with –n option to suppress ending newline)
fahr1.c (convert temperatures, version 1)
fahr2.c (convert temperatures, version 2)
fileio.c (some basic file I/O)
gcd.c (compute the greatest common denominator recursively)
hello.c (prints hello, world!)
linked.c (sort a linked list)
nfact.c (compute the factorial recursively)
pal.c (see if the argument is a palindrome recursively)
pal1.c (see if the argument is a palindrome, ignoring case, recursively)
pal2.c (see if the argument is a palindrome, ignoring nonalphanumerics, recursively)
planets1.c (sort planets by diameter, using parallel arrays)
planets2.c (sort planets by diameter, using structures)
planets3.c (sort planets by diameter, using structures, reading the information from a file)
planets4.c (sort planets by diameter, using structures, and multiple command-line arguments naming files)
printf.c (
printf
(3) Formatting)
printfile1.c (print a file version 1)
printfile2.c (print a file version 2)
printfile3.c (print a file version 3)
ptrstew.c (pointer stew)
scope.c (demonstrates C scope)
sort.c (selection sort for preset numbers)
strcpy.c (examples of how to copy a string)
strtok.c (demonstrates
strtok
(3))
swap.c (demonstrates call by value vs. call by reference)
tower.c (solve the Tower of Hanoi recursively)
tower2.c (solve the Tower of Hanoi, and show number of moves)
usort.c (selection sort for user-entered numbers)
usort2.c (selection sort for user-entered numbers with linked lists)
wctype.c (print number of different types of characters, version 1)
wctype2.c (print number of different types of characters, version 2)
ECS 30, Programming and Problem Solving
Department of Computer Science
University of California at Davis
Davis, CA 95616-8562
Version of September 24, 2015 at 11:03PM