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 the condition that is applied with ?: Operator?

0 Answers  


What does it mean when the linker says that _end is undefined?

0 Answers  


write a c program to store and print name,address,roll.no of a student using structures?

7 Answers  


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

6 Answers   TCS,


When should you not use a type cast?

0 Answers  






What are 3 types of structures?

0 Answers  


What is 2c dna?

0 Answers  


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

0 Answers  


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

2 Answers   Accenture,


Why & is used in scanf in c?

0 Answers  


what is the difference between declaration and definition of a variable or function ?

3 Answers  


Eight queens puzzle

0 Answers  


Categories