#include <stdio.h> #include <string.h> main() { char s1[20]; int len; printf("\nEnter any string: "); gets(s1); len = strlen(s1); printf("\nLength of string: %d", len); getch(); }
OUTPUT:
Enter any string: programming9.com Length of string: 16
C Program to Find Length Of a String With out Using Strlen() Function