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

  What is microprocessor - motorola 68k assembly language

What is microprocessor - Motorola 68k assembly language? Implement your plan using a user vectored interrupt number 3. Use busy line from the printer to trigger the interrupt. The printer interrupt level is 2. Explain the extra hardware to make t..

  How to create a database for music

How to create a database for music? Other entities will be Artist/Group - Attributes will be Name, Year Founded, Origin, Tones and Biography, Track - Attributes will be Number and User's Recommendation and finally Song - Attributes will be Name, ..

  Risk linked with using public infrastructure like internet

Describe in detail some probable difficulties and risk associated with utilizing a public infrastructure like the Internet, as part of the private business solution.

  Find minimal cover and identify all possible candidate keys

Find minimal cover and identify all possible candidate keys - Functional Dependencies

  Determining different sales transactions

By using example of the retail clothing store in a mall, state the relevant data flows, data stores, processes, and the sources/sinks. Find out the different sales transactions.

  Make an assignment to read rfc

Make an assignment to read RFC

  Creating program that accepts infix expression as input

The left and right sub trees of an operator explain a sub expression that is evaluated and utilized as one of the operands for operator. Write down a program that inputs an infix expression and generates an expression tree. Output prefix expressi..

  Program to input the phone numbers

Write down a program which prompts the user to enter a telephone number expressed in the letters and outputs corresponding telephone number in digits.

  Using a while structure for designing pseudocode

By using a WHILE structure for designing the pseudocode in order to prepare a monthly report for the legal clinic.

  Impact of computer on people and organizations

Impact of computer on people and organizations

  Program simulating the rolling of one dice

Write down a program which simulates rolling one dice utilizing the following steps: Prompt user for the number of sides on the dice.

  Handling the error

Alter your program so that it consider the arguments provided at the command line are integers. If there are no arguments, print the message.

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