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
Answers were Sorted based on User's Feedback
Answer / 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 |
What is hungarian notation? Is it worthwhile?
write function to reverse char array ... without using second array
Explain what is meant by 'bit masking'?
What is the main differences between C and Embedded C?
what will happen if you free a pointer twice after allocating memory dynamically ?
Explain high-order and low-order bytes.
what is output of the following statetment?Printf(“%x”, -1<<4); ?
HOW CAN ADD OUR FUNCTION IN LIBRARY.
What does static variable mean in c?
What is the diffences between Windows XP and Windows Visa
What is restrict keyword in c?
sum of two integers values only other then integer it should print invalid input.