int arr[] = {1,2,3,4}
int *ptr=arr;

*(arr+3) = *++ptr + *ptr++;

Final contents of arr[]

Answer Posted / vijaisankar

In this statement
first ptr holds base address of the array(4000),
then as per precedence operators ptr gets post incremented
(4002)though it points the value 1(4000)(ptr is post
incremented) and then ptr gets preincrement so (4004) the
value in that one is 3 then 3+1=4.
*(arr+3)=3;

Is This Answer Correct ?    2 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

will u please send me the placement papers to my mail???????????????????

1359


Explain the advantages and disadvantages of macros.

620


Why we use void main in c?

590


What is cohesion in c?

536


Explain what are header files and explain what are its uses in c programming?

623






What are the different types of errors?

635


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

2789


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

631


What are operators in c?

575


What is a stream in c programming?

588


What is a char c?

588


How would you use the functions fseek(), freed(), fwrite() and ftell()?

699


What are the differences between Structures and Arrays?

603


What is the significance of c program algorithms?

676


Explain the process of converting a Tree into a Binary Tree.

2097