#include
#include
char *input();
int length(char *);
int main()
{
char *s1,*s2;
int i;
printf(“Enter string 1:”);
s1=input();
printf(“Enter string 2:”);
s2=input();
i=length(s1);
printf(“Length of string is:%d\n”,i);
}
char *input()
{
char *s,ch;
int i=0;
s=(char *)malloc(sizeof(char));
while(1)
{
scanf(“%c”,&ch);
s=realloc(s,(i+2)*sizeof(char));
if(ch==’.’)
break;
s[i]=ch;
i++;
}
return s;
}
int length(char *s1)
{
int i=0,count=0;
while(*(s1+i)!=”)
{
count++;
i++;
}
return count;
}