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 / 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 |
Post New Answer View All Answers
Why is c platform dependent?
State two uses of pointers in C?
How can you restore a redirected standard stream?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What is modeling?
Do you know the difference between exit() and _exit() function in c?
What is the meaning of 2d in c?
What are the types of type qualifiers in c?
Why do we need functions in c?
How do I determine whether a character is numeric, alphabetic, and so on?
Explain how can you avoid including a header more than once?
What is the difference between the = symbol and == symbol?
List the difference between a "copy constructor" and a "assignment operator"?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is the usage of the pointer in c?