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
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is meant by keywords in c?
By using C language input a date into it and if it is right?
How many main () function we can have in a project?
What is modifier & how many types of modifiers available in c?
Does * p ++ increment p or what it points to?
Explain what is operator promotion?
What is conio h in c?
What is the difference between null pointer and wild pointer?
What library is sizeof in c?
What is the difference between constant pointer and constant variable?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
Why functions are used in c?
What is the collection of communication lines and routers called?
What is wrong in this statement?