c program to find length of string without using strlen function


#include<stdio.h> int main() { char name1[20]; int l1; printf("Enter string value\n"); gets(name1); l1=0; while(name1[l1]!='\0'){ l1++; } printf("String length is %d",l1); return 0; }

Output:-

Enter String value Codeverb
String length is 8