1

# Consider the following function definition and variable declarations: void square(int &n){n= n*n;} int arr[] = {1,...

## Question

###### Consider the following function definition and variable declarations: void square(int &n){n= n*n;} int arr[] = {1,...

Consider the following function definition and variable declarations:

`void square(int &n){n= n*n;}`

int arr[] = {1, 2, 3};

int number = 4;

Which of the following function calls are acceptable? (can have multiple answer)

a.square(1);

b.square(2);

c.square(arr[number]);

d.square(number);

What is the output of the following code segment?

int arr[] = {1, 4, 1, 0};

for (int i=0; i < 4; ++i)

cout<<arr[i]*2;

a.1014

b.1 4 1 0 (space in between each number)

c.1410

d.0140

e.None of the above

Given array declaration int a[] = {1, 2, 3};, the value of a is

a.1

b.2

c.3

d.Undefined (or out-of-bound error)

e.None of the above

#### Similar Solved Questions

##### Find the volume of the tetrahedron having the given vertices. (-6, -6, -5), (4, -6, -3),...
Find the volume of the tetrahedron having the given vertices. (-6, -6, -5), (4, -6, -3), (5, 4, -4), (0, 0, 10)...
##### (20%) Problern 0: 1 he figure shows an electron passing between two charged metal plates that...
(20%) Problern 0: 1 he figure shows an electron passing between two charged metal plates that create a 98 NC vertical electric field perpendicular to the electron's original horizontal velocity. (These can be used to change the electron's direction, such as in an oscilloscope.) The initial s...
##### How do you simplify #(2+3)^2 + (3+1)^2# using PEMDAS?
How do you simplify #(2+3)^2 + (3+1)^2# using PEMDAS?...
##### How do you add #1 2/5 + 4 4/10#?
How do you add #1 2/5 + 4 4/10#?...
##### 1. There are many simple experiments that can be performed to estimate r for a partic...
1. There are many simple experiments that can be performed to estimate r for a partic ular problem, and we encourage you to perform your own. The parts below discuss some experiments that we or our students have performed in the past. For each part, discuss conditions that are needed in order to sat...
##### 1 3. MgCO3co → Mg Ocss + CO2 caj a.) To prepare 70.0g start with how...
1 3. MgCO3co → Mg Ocss + CO2 caj a.) To prepare 70.0g start with how many of g Mgo you of Mg CO3 ? must b. How many as a by g of CO2 would product? be generated...
##### 9. A patient hands you a prescription for ipratropium bromide 0.5 mg/albuterol 2.5 mg solution for...
9. A patient hands you a prescription for ipratropium bromide 0.5 mg/albuterol 2.5 mg solution for nebulization. It is for one box of 60 vials and the patient is to use 1 vial q6 hrs. What day supply will you enter in the pharmacy computer system? (2 points)...
##### Multiple Choice (2 points each) Circle the best answer to each of the following questions. 1....
Multiple Choice (2 points each) Circle the best answer to each of the following questions. 1. When a company has performed services for a client but has not yet received payment, it: a. makes no entry until the cash is received. b. debits Accounts Receivable and credits Revenue. debits Accounts Paya...
##### Activity-Based Costing and Product Cost Distortion Digital Storage Concept Inc. is considering a change to activity-based...
Activity-Based Costing and Product Cost Distortion Digital Storage Concept Inc. is considering a change to activity-based product costing. The company produces two products, cell phones and tablet PCs, in a single production department. The production department is estimated to require 4,000 direct ...
##### Why do elements in the same group have a similar reactivity?
Why do elements in the same group have a similar reactivity?...
##### QUESTION 1 (a) Apart from = 0 the equation f(t) = 12 - 4sin r =...
QUESTION 1 (a) Apart from = 0 the equation f(t) = 12 - 4sin r = 0 has another root in (1, 2.5). Perform three (10) iterations of the bisection method to approximate the root. State the accuracy of the root after the three iterations. (b) Perform three iterations of Newton's method for the functi...
##### Find the general indefinite integral. 15. 14 1 - sint -dt sint Answer sin 2.c 16....
Find the general indefinite integral. 15. 14 1 - sint -dt sint Answer sin 2.c 16. dc sin 3...
##### Your tire pressure gauge indicates that the pressure in your cold tires is 250 kPa on...
Your tire pressure gauge indicates that the pressure in your cold tires is 250 kPa on a mountain at an elevation of 3500 m. (a) What is the absolute pressure in your tires? (b) After your drive down to sea level, your tires have warmed to 25 C. What does your tire pressure gauge indicate now? assume...