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

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

Final contents of arr[]

Answer Posted / anag

*(arr+3)------>arr[0][3] that means the there is any chnage
in the last value of an array
{1,2,3,--}

we know ++ has higher prededence than * so
*++ptr---->*(++ptr)
*(++ptr)----> increment in the location after that it point
to the value
it represent the second location of an array
* represent the value at this address
the value at the second location is 2.
in the second expression first it refer the value after
that it increment in the location
ptr currently points to the second location . ptr holds
that location for the second expression * represent the
value at that location that is 2.
so 2+2->4
{1,2,3,4} ----------->ans
suppose if we add a another expression after this that *ptr
then it print the value 3
because previous expression increment the location of the
value
Thank you

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

693


What is the difference between the = symbol and == symbol?

619


Write a program to generate random numbers in c?

658


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1196


Explain argument and its types.

598






Explain what are the standard predefined macros?

647


write a program to copy the string using switch case?

2397


What is the use of in c?

574


What does #pragma once mean?

682


define string ?

662


How can I manipulate individual bits?

604


What is the value of h?

587


What are the advantages and disadvantages of c language?

556


Is this program statement valid? INT = 10.50;

686


What is the meaning of ?

611