// main.c - Main program that uses symbols from math.c #include // Define the external symbol that math.c references int usrid = 42; // Declare functions from math.c that we want to use extern int square(int x); extern int pick_prime(); extern int get_n(); extern void show_values(); // Declare global variables from math.c extern int pi; extern int e; // Note: We cannot access 'randomval' or 'is_prime' from math.c // because they are declared as static (local to math.c) int main() { printf("=== Symbol Linkage Demonstration ===\n\n"); printf("1. Accessing global symbols from math.c:\n"); printf(" pi = %d\n", pi); printf(" e = %d\n", e); printf("\n2. Calling global functions from math.c:\n"); printf(" square(7) = %d\n", square(7)); printf(" pick_prime() = %d\n", pick_prime()); printf(" get_n() = %d\n", get_n()); printf("\n3. Demonstrating symbol resolution:\n"); show_values(); printf("\n4. Modifying global symbols:\n"); pi = 314; // Modify global variable from math.c printf(" Modified pi to 314\n"); printf(" pi is now = %d\n", pi); return 0; }