Suppose the following declarations are in effect int a 5 3


Suppose the following declarations are in effect int a[] = [5, 3, 35, 54, 12, 1, 33, 72]; int *P = &a;[1], *q=&a;[5]; What is the value of *(p + 3)? What is the value of *(q - 3)? What is the value of q - p? Is the condition p

Solution

#include <stdio.h>
#include <stdlib.h>

int main()
{
int a[]={5,3,35,54,12,1,33,72};
int *p=&a[1], *q=&a[5];
printf(\"value of *(p+3) is : %d\ \",*(p+3));
printf(\"value of *(q-3) is : %d\ \",*(q-3));
printf(\"value of q-p is : %d\ \", (q-p));
printf(\"value of p<q is : %d\ \",(p<q));
printf(\"value of *p<*q is : %d\ \",(*p<*q));

return 0;
}// End of the main function

------------------output of above this code is-------------------------------------------

value of *(p+3) is : 12
value of *(q-3) is : 35
value of q-p is : 4
value of p<q is : 1
value of *p<*q is : 0

----------------------------------------------------------------------

Your Anser is:-

(a). What is the value of   *(p+3) ?

Answer: 12

(b). What is the value of   *(q-3) ?

Answer: 35

(c). What is the value of   q-p ?

Answer: 4

(d). Is the condition p<q is true or false ?

Answer: True

(e). Is the condition *p < *q is true or false ?

Answer: Flase

---------------------------------------------------------

If you have any query, please feel free to ask

Thanks a lot

 Suppose the following declarations are in effect int a[] = [5, 3, 35, 54, 12, 1, 33, 72]; int *P = &a;[1], *q=&a;[5]; What is the value of *(p + 3)? Wh

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site