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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Explain the use of bit fieild.
Write a code to reverse string seperated by spaces i/p str=India is my country o/p str=aidnI si ym yrtnuoc After writing code, optimize the code
What are the different flags in C? And how they are useful? And give example for each in different consequences?
How to write c functions that modify head pointer of a linked list?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
Write a C Programm.. we press 'a' , it shows the albhabetical number is 1, if we press 'g' it shows the answer 7.. any can help me
what is the difference b/w compiler and debugger?
What is array of pointers to string?
If the size of int data type is two bytes, what is the range of signed int data type?
What is #line in c?
how to go with this?
How many bytes is a struct in c?