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
What is c mainly used for?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is the difference between array_name and &array_name?
What is sizeof int?
Is array a primitive data type in c?
What is type qualifiers?
How can you determine the size of an allocated portion of memory?
Explain built-in function?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What's a good way to check for "close enough" floating-point equality?
Can you please explain the scope of static variables?
How can I write functions that take a variable number of arguments?
How many bytes are occupied by near, far and huge pointers (dos)?
Define Spanning-Tree Protocol (STP)
What are control structures? What are the different types?