C Program to find string length without library function

How to Write a C Program to find string length without library function in C Programming Language ?


Solution:

  1. #include <stdio.h>
  2. #include <string.h>
  3. void main()
  4. {
  5.  int c;
  6.  char a[50];
  7.  printf("Enter A String: ");
  8.  gets(a);
  9.  for(c=0;a[c]!='\0';c++);
  10.  printf("\nYour entertd string is \"%s\" and its Length is \"%d\"",a,c);
  11. }


Learn More :