Suppose the following declarations are in effect int a 5 3
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 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](/WebImages/14/suppose-the-following-declarations-are-in-effect-int-a-5-3-1018153-1761526299-0.webp)