EmbLogic's Blog

c program to print string and find its leght without using

#include

int main()
{
char p[]=”amardeep singh rawat”;
int i=0;
int count=0;
printf(“String elemen are:\n”);
while(p[i]!=”)
{
printf(“%c\n”,p[i]);
i++;
count++;
}
printf(“string is:%s\n”,p);
printf(“Length of string is:%d\n”,count);
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>