C Programming Code Examples C > Recursion Code Examples C Program Find the Length of the Linked List using Recursion C Program Find the Length of the Linked List using Recursion This C Program uses recursive function & calculates the length of a string. The user enters a string to find it's length. #include <stdio.h> int length(char [], int); int main() { char word[20]; int count; printf("Enter a word to count it's length: "); scanf("%s", word); count = length(word, 0); printf("The number of characters in %s are %d.\n", word, count); return 0; } int length(char word[], int index) { if (word[index] == '\0') { return 0; } return (1 + length(word, index + 1)); }