Loading

C Program to Find String Length

C - Program to Find String Length


#include<stdio.h>
 
main()
{
   char array[100], *pointer;
   int length = 0;
 
   printf("Enter a string\n");
   gets(array);
 
   pointer = array;
 
   while(*(pointer+length))
      length++;
 
   printf("Length of entered string = %d\n",length);
 
   return 0;
}

This entry was posted in . Bookmark the permalink.

One Response to C Program to Find String Length