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 |
write a c program to store and print name,address,roll.no of a student using structures?
What is the use of void pointer and null pointer in c language?
write a c program to find the sum of five entered numbers using an array named number
what is the output of the program and explain why?? #include<stdio.h> void main ( ) { int k=4,j=0: switch (k) { case 3; j=300; case 4: j=400: case 5: j=500; } printf (ā%d\nā,j); }
in one file global variable int i; is declared as static. In another file it is extern int i=100; Is this valid ?
What is the explanation for modular programming?
What are multidimensional arrays?
How to write a C program to determine the smallest among three nos using conditional operator?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Why we use int main and void main?
Why c is a procedural language?