Determine the value of p and q in program

Assignment Help Computer Engineering
Reference no: EM1322689

Write the output of the following program.

#include <iostream>
using namespace std;

int fun ( int*& p, int* q) {
*p = 12;
p = p+3;
q = p-1;
*q = *(p+1) + *q;
*p += 2;
cout << "p=" << *p << " q=" << *q << "n";
return (*q)%(*p);
}

int main( ) {
int y[5] = {1,2,3,4,5};
int* p = y;
int *q = new int;
*q = fun ( p, q );
for (int i=0; i<5; i++)
cout << y[i] << " ";
cout << "np=" << *p << " q=" << *q;
return 0;
}

Reference no: EM1322689

Questions Cloud

Deceptive tactic of consumer protections : In reviewing all of the consumer protections, classify the two most harmful to citizens if the protection did not exist. State your rationale with your answer.
Find the probability using pareto chart : Probability using Pareto chart - Evaluate the probability of randomly selecting an adult from the sample who doesn't always eat healthy foods because he or she has no time to cook or is confused about nutrition.
Probability of selecting a value at random : What is the probability of selecting a value at random and discovering that it has a value of less than 395 pounds?
How does stakeholder identification affect communication : How does stakeholder identification affect communication? Provide an example of how a similar message might be communicated to two different stakeholders.
Determine the value of p and q in program : Write the output of the following program. #include using namespace std; int fun ( int*& p, int* q) { *p = 12;
Decisions of a business nature : Even though she is an artisan, she will need to make decisions of a business nature. What decisions or evaluations may be especially diffi cult for her?
Probability-inverse probability for normal distribution : Find the Probability and inverse probability for the given Normal distribution.
Robco company case study : Robco, Inc. was a Florida arms dealer. The armed forces of Honduras contracted to purchase weapons from Robco over a six-year period.
Probability of choosing supreme chocolate : What is the probability that at least three students choose Supreme Chocolate?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Standardizing service nomenclature

Explain how should one go regarding standardizing service nomenclature, like the process service names and outcomes, in order to obtain a level of ease with implementing enterprise wide software?

  What is the specialization of Dottie's Tax facility

What is the specialization of Dottie's Tax facility At least 6 returns? (Round z-score computation to 2 decimal places and your final answer to 4 decimal places.)

  What is home wireless network and security

What is home wireless network and security Methodology- Review topics covered in lecture hours, from textbook, reference books plus online research, to behaviour a comprehensive study about wireless network security implementation at home.

  How to write a report on object-oriented systems

How to write a report on Object-Oriented Systems?

  How to generate paper for pair of public or private rsa key

How to generate paper for a pair of public or private RSA keys? The high-class reporter for foreign affairs learned about asymmetric cryptography, and proposed to security team at the paper to generate for a pair of public or private RSA keys.

  Developing a monthly budget structure

Write down a program which declares a MonthlyBudget structure with the member variables in order to hold each of these expense categories.

  Challenges for enterprise system integration

State and discuss the challenges legacy systems pose for the enterprise system integration. Give specific examples in order to support your response.

  Utilization of cryptography

You have been hired to offer the advice regarding the utilization of the cryptography to developer of new two products within a company.

  How to expand class linkedlisttype

Expand class linkedListType. Write down a function that returns the info of the kth element of the linked list. If no such factor exists, output an appropriate message.

  Evaluating the code

Which of the following best explains the situation after Line 1 has been executed? pCdoesnothaveatarget, and pCdoesnothaveaknownvalue. pCdoesnothaveatarget, butpCdoeshaveaknownvalue.

  Generating the cipher text

Consider the plaintext is 101101101. If CBC is not used, what is the resulting ciphertext? If CBC is utilized along with the IV = 111, specify the resulting ciphertext? Show all work.

  Creating the algorithm

We suppose that we are given a majority graph in order to generate agenda for managing the sequential majority kind of election.

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