1typedef struct node{
2    int value; //this is the value the node stores
3    struct node *next; //this is the node the current node points to. this is how the nodes link
4}node;
5
6int len(node *head){
7    node *tmp = head;
8    int counter = 0;
9
10    while(tmp != NULL){
11        counter += 1;
12        tmp = tmp->next;
13    }
14    return counter;
15}