Give the output from this code fragment:

```
int *p1, *p2;
p1 = new int;
p2 = new int;
*p1 = 10;
*p2 = 20;
cout << *p1 << “ “ << *p2 << endl;
*p1 = *p2;
cout << *p1 << “ “ << *p2 << endl;
*p1 = 30;
cout << *p1 << “ “ << *p2 << endl;
```


10 20
20 20
30 20

Computer Science & Information Technology

You might also like to view...

Makers are people who want to build ________

A) their own solutions to problems B) toys and games C) non-electronic items D) professional grade electronic circuits

Computer Science & Information Technology

It is unethical for a search engine company to accept money to list a link on the first page of a search without clearly labeling it as a sponsored link

Indicate whether the statement is true or false

Computer Science & Information Technology

Frequent menu users can become annoyed if they must make several menu selections to complete a simple task. Suggest two ways you can refine the menu approach to accommodate expert or frequent users.

What will be an ideal response?

Computer Science & Information Technology

The decision logic structure:

a. Processes instructions in order of listing. b. Allows the computer to make a choice of two paths to follow. c. Allows the computer to repeat instructions. d. Allows the computer to make a choice of two or more paths to follow.

Computer Science & Information Technology