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

What is a buffer in c?

0 Answers  


Who is the founder of c language?

0 Answers  


What is mean by data types in c?

0 Answers  


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

0 Answers   Microsoft,


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers   Vector India,


HOW DO YOU HANDLE EXCEPTIONS IN C?

2 Answers   AppLabs,


What is use of bit field?

0 Answers  


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

0 Answers  


Write a routine that prints out a 2-D array in spiral order!

1 Answers   Lucent,


How is a null pointer different from a dangling pointer?

0 Answers  


What is Your Name :)

1 Answers  


How does the assert() function work?

2 Answers  


Categories