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
Explain the bubble sort algorithm.
How does #define work?
What is function definition in c?
What is void main () in c?
For what purpose null pointer used?
What is the use of c language in real life?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What is meant by type casting?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
what is the difference between 123 and 0123 in c?
what is the difference between class and unio?
What are the types of pointers in c?
What is the explanation for prototype function in c?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
Explain what are compound statements?