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



12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",..

Answer / rakesh

B)only 2

Is This Answer Correct ?    4 Yes 1 No

12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",..

Answer / basha

error: wrong type argument to increment

Is This Answer Correct ?    2 Yes 1 No

12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",..

Answer / fakkad

2

Is This Answer Correct ?    1 Yes 1 No

12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",..

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

Post New Answer

More C Interview Questions

What is hungarian notation? Is it worthwhile?

0 Answers  


write function to reverse char array ... without using second array

3 Answers  


Explain what is meant by 'bit masking'?

0 Answers  


What is the main differences between C and Embedded C?

9 Answers  


what will happen if you free a pointer twice after allocating memory dynamically ?

3 Answers   Novell,






Explain high-order and low-order bytes.

0 Answers  


what is output of the following statetment?Printf(“%x”, -1<<4); ?

5 Answers  


HOW CAN ADD OUR FUNCTION IN LIBRARY.

5 Answers  


What does static variable mean in c?

0 Answers  


What is the diffences between Windows XP and Windows Visa

1 Answers   Aricent, FHF,


What is restrict keyword in c?

0 Answers  


sum of two integers values only other then integer it should print invalid input.

1 Answers  


Categories