C_UCSC is a collection of C programming exercises and experiments. The repository gathers small standalone programs that demonstrate basic data structures, file I/O, randomization, math functions, and simple algorithmic logic.
| Program | Purpose | Main concepts |
|---|---|---|
7-Card.c |
Simulates drawing 7-card poker hands and reports frequency of hand types. | randomization, structs, enums, simulation, probability |
Fix-2nfMistake.c |
Computes the volume of a sphere from a radius input. | console I/O, arithmetic, constants |
Fix-D.P-s-mistake.c |
Prints absolute sine values for fixed intervals. | math functions, loops, formatting |
avg-meth-2.c |
Computes the average weight of elephant seals from an embedded array. | arrays, aggregation, average calculation |
avg-weight-eleph.c |
Reads elephant seal weights from a file and computes average weight. | file I/O, parsing, error checking |
bst_inorder_from_file.c |
Builds a binary search tree from file data and prints sorted values. | binary search tree, recursion, file input |
employee_generator.c |
Generates random employee records with salaries and departments. | structs, enums, random values, formatted output |
int-RS-DoubleList.c |
Creates a doubly linked list, removes duplicates, and prints results. | doubly linked list, dynamic memory, duplicate removal |
int-random-store.c |
Generates random integers in a linked list and sorts them with bubble sort. | singly linked list, algorithm, sorting, dynamic memory |
poem.c |
Prints a fixed poem text to standard output. | console output, string literals |
ratio_sum_avg.c |
Reads rational numbers from a file and computes their sum and average. | structs, rational arithmetic, file input |
sin-gen.c |
Reads a value and prints its sine. | math library, user input, validation |
vals-sin-cos.c |
Prints a table of sine and cosine values for x from 0 to 1. | math library, loops, formatted output |
Use the following command pattern to compile each program:
cc -Wall -Wextra -Werror filename.c -o programSome programs may require:
-lmfor mathematical functions,- input files such as
input.txt,elephant_seal_data.txt, orrationals.txt, - user input or command-line interaction.
These are personal educational implementations and not official assignment solutions.
- wkratos
- GitHub: https://github.com/wkratos