how to generate the length of a string without using len
funtion?
Answer Posted / shruti
** same as above.. only u should initialise the valued of
varibale len to 0..
otherwise it will pick up some garbage value.. **
int strlength(char s[])
{
int i , len;
len = 0;
for(i = 0 ; s[i] != '/0' ; i++)
{
len++;
}
return len;
}
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Why does this code crash?
What is data structure in c programming?
What is action and transformation in spark?
Explain about C function prototype?
Which programming language is best for getting job 2020?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Explain the difference between malloc() and calloc() in c?
What do you mean by dynamic memory allocation in c? What functions are used?
How can I read in an object file and jump to locations in it?
What are linker error?
how to introdu5ce my self in serco
What is pointer to pointer in c?
What is the advantage of using #define to declare a constant?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Explain how does flowchart help in writing a program?