Here we find the length of the given string without any use of the predefined library.
Example-
string is "r4r_string"
Length is : 10
program-
#include< stdio.h>
int main()
{
char ch[20];
int len=0,i=0;
printf("Enter string\n");
scanf("%s",&ch);
while(1)
{
if(ch[i++]!='')
len++;
else
break;
}
printf("Length of the string is %d",len);
}
Enter string
Mystring
Length of the string is 8