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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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