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...


1)what is the error in the following stmt where str is a
char array and the stmt is supposed to traverse through the
whole character string str?

for(i=0;str[i];i++)

a)There is no error.
b)There shud be no ; after the stmt.
c)The cond shud be str[i]!='\0'
d)The cond shud be str[i]!=NULL
e)i shud be initialized to 1

Answers were Sorted based on User's Feedback



1)what is the error in the following stmt where str is a char array and the stmt is supposed to tra..

Answer / rajesh

options A and C are correct....
Check it in C programming online editor www.codepad.org

Is This Answer Correct ?    4 Yes 0 No

1)what is the error in the following stmt where str is a char array and the stmt is supposed to tra..

Answer / niranjan kumar niraj

b)The cond shud be str[i]!='\0'

Is This Answer Correct ?    1 Yes 0 No

1)what is the error in the following stmt where str is a char array and the stmt is supposed to tra..

Answer / gayitri91

undoubtedly,the answer should be 'c'(the condition should be
str[i]!='\0'
correct syntax:
for(i=0;str[i]!='\0';i++)

Is This Answer Correct ?    2 Yes 2 No

1)what is the error in the following stmt where str is a char array and the stmt is supposed to tra..

Answer / vinod

Options D,E are correct for this

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

Why do we use static in c?

0 Answers  


how to write a program which adds two numbers without using semicolon in c

2 Answers  


why array index always starts from zero??

4 Answers   TCS,


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

0 Answers  


How does C++ help with the tradeoff of safety vs. usability?

1 Answers  


Explain what are the different data types in c?

0 Answers  


what does ‘#include’ mean?

1 Answers   TCS,


What are nested functions in c?

0 Answers  


How can I find leaf node with smallest level in a binary tree?

1 Answers  


How can I sort more data than will fit in memory?

0 Answers  


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

0 Answers  


write a program wch produces its own source code aas its output?

1 Answers   IonIdea,


Categories