C Programming
Computer Programming

C program to find the length of a String without using Library Function



Write a program in C to find the length of a String without using Library Function

\* C program to find the length of a String without using Library Function *\

# include < stdio.h >
# include < conio.h >
int   main( )
{

char s[1000] ;
int i ;
printf("\n Enter a string: ") ;
scanf("%s", s) ;
for(i = 0; s[i] != '\0'; ++i) ;
printf(" Length of string is : %d", i) ;
return (0) ;

}

Output of Program :

Output of C program to find the length of a String without using Library Function