Length of string without using function in C Find length without using function strlen() in C. The program gets a string from user. The counter is initially set to zero, when string is entered one by one the counter is incremented by 1. When string is entered completely and hit enter the compiler adds '\0' at the end of string. Counter keeps incrementing until '\0' is not entered. Counter is printed at the end of program.