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 the condition that is applied with ?: Operator?
What does it mean when the linker says that _end is undefined?
write a c program to store and print name,address,roll.no of a student using structures?
Which of the following about the C comments is incorrect ? a.commentscan go over multiple lines b.comments can start any where in the line c.a line can contain comments with out any language statements d.comments can occur within comments
When should you not use a type cast?
What are 3 types of structures?
What is 2c dna?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above
Why & is used in scanf in c?
what is the difference between declaration and definition of a variable or function ?
Eight queens puzzle