/* Structure for a linked list*/
struct list{
   int num;
   struct list* next; /* pointer to next node in list*/
};
/* Function to find the length of linked list using recursion, given the starting node pointer*/
int length(struct list* node)
{
   if(node->next == NULL)
      return 1;
   else
      return (1 + length(node->next));
}
/* Function to use the linked list functions*/
int main()
{
   struct list* node = NULL;
   struct list* new = NULL;
   int i;
   for(i=0; i < 10; i++)
   {
      insert(&node,i);
   }
   printf(“%d\nâ€,length(node));
}