C program to find the length of a string

C program to find the length of a string:
If you are using any software then below program will not give an error, but if you are using TURBO C then you have to make some changes like: void main() and some function like clrscr() or getch().

   char str[100];
   int len;

   printf("Enter the String : ");


   printf("\nLength of Given String : %d",len);


Enter the String : BaronTuts

Length of Given String : 9


Leave a Reply

Your email address will not be published. Required fields are marked *