The following statements are in C++:
1. Consider the following statements:
int *p;
int i, k;
i = 50;
k = i;
p = &i;
After these statements, which of the following statements will change the value of i to 15?
a) k = 15;
b) *k = 15;
c) p = 15;
d) *p = 15;
e) Two or more of the answers will change i to 15.
Option D is the only correct answer.
For statement k=i
K will assigned with new addressed
It don't have any relation with i
So a and b are wrong
And for statement p=15
P points to address 15
So C is also wrong..
For *p=15 updates the content of I address
Example let 1000 is the address of I and 1002 is the address of
k.
Now p holds 1000
*p =15 updates the content of address of 1000.
So Option D is correct answer..
The following statements are in C++: 1. Consider the following statements: int *p; int i, k;...