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
What is the modulus operator?
What is the use of a semicolon (;) at the end of every program statement?
What is the use of in c?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
Write a program that accept anumber in words
What is the difference between ‘g’ and “g” in C?
What is the acronym for ansi?
What does s c mean in text?
Is c pass by value or reference?
Explain what’s a signal? Explain what do I use signals for?
What is dynamic variable in c?
how to create duplicate link list using C???
What is the difference between functions getch() and getche()?
What are the disadvantages of external storage class?
How do you use a pointer to a function?