What is the output of the following code

Assignment Help C/C++ Programming
Reference no: EM13340062

1. What is the output of the following code?
int *p;
int *q;
p = new int;
q = p;
*p = 46;
*q = 39;
cout << *p << " " << *q << endl;

2. What is the output of the following code?
int *p;
int *q;
p = new int;
*p = 43;
q = p;
*q = 52;
p = new int;
*p = 78;
q = new int;
*q = *p;
cout << *p << " " << *q << endl;

Reference no: EM13340062

Questions Cloud

What is the x-component of the electric force exerted by a : Particle A of charge 5.00x10-4 C is at the origin, particle B of charge -5.00x10-4 C is at (3.00 m, 0) and particle C of charge 3.00x10-4 C is at (0, 2.00 m).
One current economic issue facing the american government : One current economic issue facing the American government is ensuring people in danger of foreclosing on their homes can keep them. Explain why this issue is important
How many kilograms of water are poured onto a fire : Three fire hoses are connected to a fire hydrant. Each hose has a radius of 0.013 m. Water enters the hydrant through an underground pipe of radius 0.094 m. In this pipe the water has a speed of 3.2 m/s.
Review current standards across all similar job title : There are many elements and measures for workforce effectiveness. One measure of effectiveness is that all employees within a specific job title, such as program assistant, are held to the same standards.
What is the output of the following code : What is the output of the following code?
What is electric field at a point midway between two charges : Two point charges are separated by 10.0 cm and have charges of +2.00 and -2.00 Coulombs. What is the electric field at a point midway between the two charges
What difference of temperature is needed to have volume : Rivets can be cooled before they are put in place, thus when they reach equilibrium temperature they are more firmly fixed in place. If the volume expansion of iron is 35.0 X 10-6 K-1
Explain how the nominal dollar/euro exchange rate would be : Explain how the nominal dollar/euro exchange rate would be affected (all else equal) by permanent changes in the expected rate of real depreciation of the dollar against the euro.
The legal and ethical considerations of marketing in america : The Legal and Ethical Considerations of Marketing in America Paper

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Saddle point is an element

For a square nXn a array, a saddle point is an element that is the maximum in its row and the minimum in its column.

  Write a program that displays a weekly payroll report

Write a program that displays a weekly payroll report

  Calculate the trajectory of a soccer ball

Write a program to calculate the trajectory (flight path) of a soccer ball

  Write a program that will read in 5 numbers

Write a program that will read in 5 numbers and add 10 to the first number, 20 to the second number, and 30 to the third number, 40 to the fourth and 50 to the 50th.

  Write the definition of the member function two of yclass

Write the definition of the member function two of yClass so that the private member variable a is initialized to the value of the first parameter of two, and the private member variable b is initialized to the value of the second parameter of two..

  Create constructor function which takes no inputs

You must have the constructor function which takes no inputs and randomly generates the 5 letter string for name and random integers from 20 to 40 for both age and class size.

  What do the loops print

What do the following loops print? Work out the answer by tracing the code, not by using the computer. a. int s = 1; for (int n = 1; n

  Compute for the monthly billing of their customers

An electric company wants to compute for the monthly billing of their customers. the company charges P2.50 per kwh and utility tax of 3% of the current bill shall be added.

  Create a job class that holds a job id

Create a Job class that holds a Job ID number and the cost of the Job. Include insertion and extraction operators. Create a JobException class that holds a Job and an error message

  Describe an example of a base

Describe an example of a base and a derived class that shows base-class functions that are overridden in the derived class. Provide the syntax, showing the class definitions of both classes.

  How many whole numbers they wish to enter

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order.

  How do you generate arrays, random numbers

How do you generate arrays, random numbers and multiply and add rows, columns and diagonals in C

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd