Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

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

a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

Answer / subbu

l=7 is the right answer, which is not given in the options.

Is This Answer Correct ?    10 Yes 8 No

a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

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

a memory of 20 bytes is allocated to a string declared as char *s then the following two stateme..

Answer / sivasankar.a

the answer is c)9 because of "etrance"this word lengh is 9.

Is This Answer Correct ?    3 Yes 19 No

Post New Answer

More C Interview Questions

How can you increase the size of a dynamically allocated array?

0 Answers   TISL,


what's the return value of malloc()

9 Answers  


What is the function of volatile in c language?

0 Answers  


Difference between macros and inline functions? Can a function be forced as inline?

0 Answers   HAL, Honeywell, Zomato,


what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; }

3 Answers   Honeywell,


What are 3 types of structures?

0 Answers  


#include<string.h> void main() { String s1[]={"swathi"}; string s2[]={"maddimsetti"}; s1[]=s[]; printf("%s",s1[]); }

3 Answers   IBM,


What does typeof return in c?

0 Answers  


What are the features of the c language?

0 Answers  


What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }

1 Answers  


What is #include in c?

1 Answers  


What is data structure in c programming?

0 Answers  


Categories