how to find string length wihtout using c function?

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
int str_len(char *)
void main()
{
char s[30];
int count;
printf("enter the string :");
gets(s);
count=str_len(s);
printf("the length is :%d",count);
getch();
}
int str_len(char *a)
{
int i=0;
while(*a!='\0')
a++;
i++;
}
return i;
}

thank u

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c mainly used for?

597


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2401


What is the difference between array_name and &array_name?

776


What is sizeof int?

635


Is array a primitive data type in c?

577






What is type qualifiers?

660


How can you determine the size of an allocated portion of memory?

743


Explain built-in function?

593


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

661


What's a good way to check for "close enough" floating-point equality?

628


Can you please explain the scope of static variables?

600


How can I write functions that take a variable number of arguments?

626


How many bytes are occupied by near, far and huge pointers (dos)?

668


Define Spanning-Tree Protocol (STP)

643


What are control structures? What are the different types?

597