C Program to Find Length of String Without using Library Function

C Program to Find Length of String Without using Library Function

#include<stdio.h>
 
int main() {
   char str[100];
   int count;
 
   printf("\nEnter the String : ");
   gets(str);
 
   count= 0;  // Initial Length
 
   while (str[count] != '\0')
      count++;
 
   printf("\nLength of the String is : %d", count);
   return(0);
}
Disqus Comments