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

Can a program have multiple main() functions?

1 Answers  


how does printf function work

1 Answers  


Is c easier than java?

0 Answers  


Wt are the Buses in C Language

0 Answers   Infosys,


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

0 Answers   Wilco,


Explain how can you tell whether a program was compiled using c versus c++?

0 Answers  


how to TOGGLE Nth bit of variable in a MACRO

1 Answers   NDS,


What is #ifdef ? What is its application?

0 Answers   TCS,


the maximum value that an integer constant can have is a) -32767 b) 32767 c) 1.701e+38 d) -1.7014e+38

1 Answers  


What is anagram in c?

0 Answers  


simple c program for 12345 convert 54321 with out using string

7 Answers   TCS,


what is difference b/w extern & volatile variable??

6 Answers   Teleca,


Categories