1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mnenie [13.5K]
3 years ago
6

Given the function definition void something ( int a, int& b ) { int c; c = a + 2; a = a* 3; b = c + a; } what is the output

of the following code fragment that invokes something? (All variables are of type int.) r = 1; s = 2; t = 3; something(t, s); cout << r << ' ' << s << ' ' << t << endl;
Computers and Technology
1 answer:
timurjin [86]3 years ago
8 0

Answer:

1 14 3

Explanation:

If that code fragment is put under a main() function and then it will yield the above output. According to the function something(), only changes in value second parameter will be reflected and first will be unchanged because second is passed by reference and the first one is passed as value so only address of 's' is passed, so, only its value is changed and the rest are same.

You might be interested in
What mistake might you make related to changing the data in a cell that's used in a formula?
scoundrel [369]

Answer:

ojalat sirve

Explanation:

Cuando en una fórmula, en vez de indicar una celda, fila o columna estamos enlazando una hoja de cálculo o libro, debemos hacerlo con comilla simple. Si empleamos otro signo o símbolo separador, la fórmula no entenderá correctamente lo que le estamos indicando.

6 0
3 years ago
The internet is an example of
DochEvi [55]
A large multi user program
6 0
3 years ago
Read 2 more answers
Write a function add_spaces(s) that takes an arbitrary string s as input and uses recursion to form and return the string formed
kvasek [131]

Answer:

The solution code is written in Python:

  1. def add_spaces(s):
  2.    if len(s) < 2:
  3.        return s  
  4.    else:
  5.        return s[0] + " " + add_spaces( s[1 : ] )

Explanation:

Recursive function is a function that will call itself within the same function.

Let create a function named add_spaces() that take one input string, s (Line 1).

Next, create an if condition to check if the length of the input string is less than 2 (this means if the string has only one character), return the current string (Line 2-3).

Otherwise, it should return the first character of string, s[0] concatenated with a single space " " and concatenated again with the return output from the recursive calling add_spaces() that take s[1: ] as input parameter (Line 4-5). Please note s[1: ] is an expression we get the substring of the current string from position 1 till the end of string.

5 0
3 years ago
Read 2 more answers
A network administrator has received the IPv6 prefix 2001:DB8::/48 for subnetting. Assuming the administrator does not subnet in
Vesnalui [34]

Answer:

d. 65536

Explanation:

When the network administrator received the IPV6 prefix for subnetting and we have assumed that the administrator does not subnet into their interface ID portion.So the number of subnets the administrator can create from the /48 prefix are 65536.

Hence the answer to this question is 65536.

3 0
3 years ago
In what year was the first phone using the android operating system sold in the united states?
inn [45]
In 2008 was when the first android operating system was sold in the United States.
8 0
3 years ago
Other questions:
  • Which practice enables recovery of accidental deletions in data records?
    15·2 answers
  • How does soil lose its value? A.When the top soil is stripped by wind or water B.When the bedrock is damaged by animals C.When w
    15·1 answer
  • An automated search feature used by search engines to find results that match your search terms is called a spider or ?
    5·1 answer
  • Can somebody help I need it now please and thank you correct answer please
    10·2 answers
  • The valence electron configurations of several atoms are shown. how many bonds can each atom make without hybridization? 2s^2 2p
    12·1 answer
  • ASAP!!!!!!!
    9·2 answers
  • Give five example of secondary storage device, stating their function and storage capacity​
    6·1 answer
  • Select the correct answer.
    10·1 answer
  • May I ask, when you accidently drop your laptop into a pool,...(water) . Will the Data and Many other information... inside the
    5·2 answers
  • In which of the following cases is the application of a nested loop not justified? When comparing two lists of integers When for
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!