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 / niranjan kumar niraj

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

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of fflush() function?

614


What is #include stdlib h?

604


What is your stream meaning?

589


How many keywords (reserve words) are in c?

603


What is class and object in c?

577






What is the size of empty structure in c?

579


What are enumerated types?

644


How can I call fortran?

630


What is advantage of pointer in c?

679


Explain union.

629


What are reserved words?

639


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1519


What are the similarities between c and c++?

588


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

548


Explain how do you determine a file’s attributes?

584