#include<string.h>
main()
{
char s[50];
int i=0;
printf("enter a string\n");
gets(s);
while(s[i]!='\0')
{
i++;
}

printf("The length of the given string is %d",i);
}
     
           
Note: Need to be arranged in compiler after copied
   

 OutPut:

enter a string Hello World The length of the given string is 11