a memory of 20 bytes is allocated to a string declared as
char *s then the following two statements are executed:
s="Etrance"
l=strlen(s);
what is the value of l ?
a.20
b.8
c.9
d.21
Answers were Sorted based on User's Feedback
Answer / fazlur rahaman naik
the string is Entrance or Etrance?
if it is Entrance,then only the answer is here.
b is the right answer.
because string length means it will count only the no.of
characters in that string only...not the null character.
| Is This Answer Correct ? | 23 Yes | 1 No |
Answer / subbu
l=7 is the right answer, which is not given in the options.
| Is This Answer Correct ? | 10 Yes | 8 No |
Answer / valli
20 bytes of memory is allocated to s
hence
l=strlen(s);//l=20
so answer is a
| Is This Answer Correct ? | 2 Yes | 14 No |
Answer / sivasankar.a
the answer is c)9 because of "etrance"this word lengh is 9.
| Is This Answer Correct ? | 3 Yes | 19 No |
Explain how can I convert a string to a number?
What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }
8 Answers MindFire, TCS, Tech Mahindra,
write a program to remove duplicate from an ordered char array? in c
/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20%,da18%/*
Program to write some contents into a file using file operations with proper error messages.
Explain what header files do I need in order to define the standard library functions I use?
What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }
How can I do graphics in c?
Tell me what is null pointer in c?
when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none
if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how?
how to introdu5ce my self in serco