#include<stdio.h>
int string_length(int j, char a[])
{
while(a[j]!='\0')
{
j++;
}
return j;
}
int main()
{
char s[50];
int i=0,l;
printf("enter a string\n");
gets(s);
l=string_length(i, s);
printf("l=%d",l);
}
Note: Need to be arranged in compiler after copied
OutPut:
enter a string
Hello World
l=11