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

write a c program to add two integer numbers without using arithmetic operator +

13 Answers   Value Labs,


will the program compile? int i; scanf(ā€œ%dā€,i); printf(ā€œ%dā€,i);

3 Answers  


What is meant by realloc()?

0 Answers  


write a program to find the frequency of a number

4 Answers   Infosys,


progrem to generate the following series 1 12 123 1234 12345

6 Answers   HCL, Wipro,






though sbi was nationalized why its not comes under nationalized banks and its comes under publicsector banks

3 Answers   State Bank Of India SBI,


how to find sum of 5 digits in C?

4 Answers  


wap in c to accept n number display the highest and lowest value

2 Answers  


what is the use of #pragma pack, wer it is used?

2 Answers   Wipro,


what is event driven software and what is procedural driven software?

0 Answers  


Is there any book to know about Basics of C Language?

4 Answers  


what are two categories of clint-server application development ?

1 Answers  


Categories