EmbLogic's Blog

c program to find string length using string.h

#include
#include
int main()
{
char s1[]=”Amar”,s2[]=”deep rawat”;
int i,j;
j=strcmp(s1,s2);
if(j>0)
printf(“S1 is greater than S2\n”);
if(j<0)
printf("S1 is smaller than s2\n");
strcat(s1,s2);
printf("Concatination is:%s\n",s1);
i=strlen(s1);
printf("Length of string after concatination is:%d\n",i);

return 0;
}

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>