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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between null pointer and wild pointer?

1178


Differentiate between new and malloc(), delete and free() ?

1163


What are qualifiers and modifiers c?

988


How can you increase the allowable number of simultaneously open files?

1137


Why are all header files not declared in every c program?

1087


Between macros and functions,which is better to use and why?

2191


What is a union?

1017


Why flag is used in c?

1113


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6831


Explain how can type-insensitive macros be created?

980


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

2219


write an algorithm to display a square matrix.

2689


What is type qualifiers?

1117


Which one would you prefer - a macro or a function?

1065


Write a program to identify if a given binary tree is balanced or not.

1136