main( )

{

int a[ ] = {10,20,30,40,50},j,*p;

for(j=0; j<5; j++)

{

printf(“%d” ,*a);

a++;

}

p = a;

for(j=0; j<5; j++)

{

printf(“%d ” ,*p);

p++;

}

}



main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) ..

Answer / susie

Answer :

Compiler error: lvalue required.

Explanation:

Error is in line with statement a++. The operand must be an
lvalue and may be of any of scalar type for the any
operator, array name only when subscripted is an lvalue.
Simply array name is a non-modifiable lvalue.

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More C Code Interview Questions

int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 Answers  


void main() { int const * p=5; printf("%d",++(*p)); }

3 Answers   Infosys, Made Easy, State Bank Of India SBI,


Write a program that find and print how many odd numbers in a binary tree

1 Answers  


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


Write a procedure to implement highlight as a blinking operation

2 Answers  






Write a routine to implement the polymarker function

0 Answers   TCS,


create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...

6 Answers   Microsoft, MSD, Oracle,


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


Is the following code legal? struct a { int x; struct a *b; }

2 Answers  


What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 Answers  


how can i cast a char type array to an int type array

2 Answers  


Categories