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

  Knowledge revolution and industrial revolution

What are your thought on this that would support notion that Knowledge Revolution was born from the Industrial Revolution?

  Structured query language

Structured Query Language (SQL) refers to the accepted non-procedural language used in order to communicate with all the relational databases.

  Explain fast process of distributing the cards to accountant

Explain fast process of distributing the cards to accountant.

  Activity diagram and a use case diagram

AREI real estate agents utilize its information in order to search AREI’s database and the different listing service for houses which meet their needs.

  Program to count the number of times page is opened

Generate a page in order to count the number of times the page is viewed by the user in a single session. Each time page is refreshed or opened in the browser during the session counts as 1 page view.

  Generate a class name that starts with string variable

Generate a class Name that starts with string variable

  Sdlcs and other sites explaining some of the tools

Visit web sites for the few leading information systems consulting the firms. Try to determine the information regarding the approach they utilize in order to develop systems. Specify whether SDLCs are described there? Also state do their sites ex..

  Classify traditional grade school algorithms

Classify traditional grade school algorithms

  Database and characteristics of database

Explain the Database and describe the four characteristics of the database? Explain the Relational Database and generate a relational database for 5 employees.

  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?

  Wireless networking

Explain the origins/genesis of the wireless networking. Explain the devices included used and how they operate.

  Utilize server manager to install dns role

Utilize Server Manager to install DNS role

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