12. Look at the Code:
main()
{
int a[]={1,2,3},i;
for(i=0;i<3;i++)
{
printf("%d",*a);
a++;
}
}
Which Statement is/are True w.r.t the above code?
I.Executes Successfully & Prints the contents of the array
II.Gives the Error:Lvalue Required
III.The address of the array should not be changed
IV.None of the Above.
A)Only I B)Only II C)II & III D)IV
Answer Posted / jaleelbaig
2 gives the error because array name is nothing but a
constant pointer we cannot increment the constant pointer so
it will give error
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What do you mean by scope of a variable in c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
How is null defined in c?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is sizeof int?
What happens if you free a pointer twice?
What do you mean by dynamic memory allocation in c? What functions are used?
Describe the modifier in c?
What are the features of the c language?
Explain how do you search data in a data file using random access method?
What is #error and use of it?
What is the difference between far and near ?
What are header files and what are its uses in C programming?
How to Throw some light on the splay trees?
What is static volatile in c?