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 |
How do you list a file’s date and time?
Is c weakly typed?
what is a function prototype?
What is the difference between void main and main in c?
wht is the difference between KPO and BPO ?
2 Answers Accenture, BPO, HCK, HCL, Infosys,
which operator having highest precedence? a.)+ b.)++ c.)= d.)%
What does node * mean?
What are the 4 types of unions?
What are the advantages of using Unions?
without using arithmatic operator convert an intger variable x into x+1
Write a program in c using only loops to print * * * * * *******
Define function pointers?