# **⚡ Booth: C (1972)**

* **Creator:** Dennis Ritchie (Bell Labs)  
* **Design Philosophy:** A systems programming language intended to be high-level enough to provide control flow, structured records, and portability across architectures, yet low-level enough to interact directly with hardware.  
* **Key Innovations:** First-class pointers, direct raw memory manipulation, curly-brace block syntax ({}), and a unified compiler that allowed UNIX to be written in a portable high-level language instead of machine-specific assembly.

## **🚀 Hello, World\!**

\#include \<stdio.h\>

int main() {  
    printf("Hello, World\!\\n");  
    return 0;  
}

## **🎨 Showpiece: Singly Linked List Insertion**

This program demonstrates C's power over raw pointers, structures, and dynamic memory allocation on the heap.

\#include \<stdio.h\>  
\#include \<stdlib.h\>

// Self-referential structure  
struct Node {  
    int data;  
    struct Node\* next;  
};

// Function to insert a node at the head  
void insertAtHead(struct Node\*\* head\_ref, int new\_data) {  
    // 1\. Allocate memory for the new node  
    struct Node\* new\_node \= (struct Node\*)malloc(sizeof(struct Node));  
      
    // 2\. Put in the data  
    new\_node-\>data \= new\_data;  
      
    // 3\. Link the old list to the new node  
    new\_node-\>next \= (\*head\_ref);  
      
    // 4\. Move the head pointer to point to the new node  
    (\*head\_ref) \= new\_node;  
}

void printList(struct Node\* node) {  
    while (node \!= NULL) {  
        printf("%d \-\> ", node-\>data);  
        node \= node-\>next;  
    }  
    printf("NULL\\n");  
}

int main() {  
    struct Node\* head \= NULL;

    insertAtHead(\&head, 30);  
    insertAtHead(\&head, 20);  
    insertAtHead(\&head, 10);

    printf("Created Linked List: ");  
    printList(head);

    // Free allocated memory  
    struct Node\* temp;  
    while (head \!= NULL) {  
        temp \= head;  
        head \= head-\>next;  
        free(temp);  
    }

    return 0;  
}  
