Determining the output of code

Assignment Help Computer Engineering
Reference no: EM1322684

a) Provide the output of the following given program.

#include <iostream>
using namespace std;
void fun1 (int *p, int *&q) {
*p = 100;
p = p + 2;
*p = *q;
*q = *(p+1);
cout << "p=" << *p << " q=" << *q << "n";
}
bool fun2 (int x[], int size) {
int *p = x;
int *q;
q = p;
for (int i=1; i<size; i++) {
x[i] += x[i-1];
cout << x[i] << " ";
}
cout << "n";
fun1 (p, q);
return (*p == *q);
}
int main ( ) {
int a[5] = {2,4,6,8,10};
if (fun2 (a,5))
cout << "truen";
else
cout << "falsen";
for (int i=0; i<5; i++)
cout << a[i] << " ";
return 0;
}

Reference no: EM1322684

Questions Cloud

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?
Determining the output of code : Provide the output of the following given program:#include using namespace std; void fun1 (int *p, int *&q) {*p = 100;p = p + 2;*p = *q; *q = *(p+1);
Find the p-value : Hypothesis testing of single mean - can we conclude that the mean weight is greater than 16 ounces? Determine the  p -value.
Hypothesis testing of single mean : Hypothesis testing of single mean - The Wall Street Journal reported that the 30-year mortgage rate is now less than 6%.
Population standard deviations - hypothesis test : Hypothesis test for the difference between two means - Assume the population standard deviations are not the same. At the 0.05 significance level, is there a difference in the mean waiting time?
Program to calculate value of d=b squared-4ac : Provided that a method takes three parameters a, b, c, of type double, state some code, to be involved as a part of the method, which calculates whether the value of "b squared" – 4ac is negative. If negative, code prints out the message "no real sol..

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Explain the design for the memory subsystem

Explain the design for the memory subsystem

  Implementing the stack using dynamically allocated array

Write down the C++ class which implements the stack utilizing the dynamically allocated array. The initial size of the particular stack must be evaluated when it is generated.

  Which would create a better product

Which would create a better product

  Create a white paper based on knowledge

Create a white paper based on knowledge

  Recoginizing the error in given code

Identify the problem in the above code, If ( toupper( response[ 0 ] ) == 'Y' )

  Generating a class known as point

Generate a class known as Point which has following private members: Float x - x-coordinate of point,,Float y - y-coordinate of point.

  How many register windows must be saved to memory

How many register windows must be saved to memory.

  Creating the table

Build a table which summarizes the risks faced by the RMO for this new project. Involve four columns titled (1) Project risk, (2) Type of risk.

  Describe mutual strategy to maintain enterprise-level system

Describe mutual strategy to maintain enterprise-level system

  How to plan a payroll class

How to plan a PayRoll class.

  Wda wireless device application business models

Write down a 2.5 - 3 page paper comparing the WDA wireless device application business models utilized by Sprint, Verizon, and AT&T Wireless.

  Designing a solution to the problem

Designing a solution to the problem and implementing the design using principles of correct syntax

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