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
Lady_Fox [76]
2 years ago
9

What will the following code display? #include using namespace std; void doSomething(int); int main() { int x{2}; cout <<

x << '\n'; doSomething(x); cout << x << '\n'; return 0; } void doSomething(int num) { num = 0; cout << num << '\n';
Computers and Technology
1 answer:
Leno4ka [110]2 years ago
8 0

Answer:

The code will display the following on the screen:-

2

0

2

Explanation:

The output is like this because x{2} assigns the value 2 to the integer x.First the value of x is printed on the screen that is 2 and that newline is used to go to the next line.After that function is called doSomething with x passed as the argument. doSomething function assigns the value zero to the variable passed and prints it on the screen.So the next line is 0.Since x is passed by value so no changes will appear in the original argument.Hence the last line printed is 2.

You might be interested in
Samuel is working on decimal and binary conversion for his college project. He is using the binary number 111011 and wants to ex
Contact [7]
<span>1 X 25 + 1 X 24 + 1 X 23 + 0 X 22 + 1 X 21 + 1 X 20 thus your Answer is C</span>
4 0
2 years ago
Read 2 more answers
A characteristic often associated with entrepreneurship is
FromTheMoon [43]

Answer:

with small businesses

Explanation:

to make a lager profit

3 0
2 years ago
write an expression taht evaluated to true if and only if the variable s does not contain the string 'end'
natima [27]

Answer:

//check which string is greater

if(strcmp(name1,name2)>0)

//assign name1 to first, if the

    //name1 is greater than name2

    first=name1;

else

    //assign name2 to first, if the

    //name2 is greater than name1

    first=name2;

5)

//compare name1 and name2

    if(strcmp(name1,name2)>0)

   

         //compare name1 and name3

         if(strcmp(name1,name3)>0)

       

             //assign name1 to max, becuase

             //name1 is greater than name2 and name3

             max=name1;

       

Explanation:

7 0
2 years ago
Which of these port transmits digital video
DaniilM [7]

Answer:

uhm

Explanation:

theres nothing there

7 0
2 years ago
Read 2 more answers
[c++] Write a recursive function takes a word string as input argument and reverse the word. Print out the results of recursive
Aleks04 [339]
I will try to give you the best answer I can possibly come up with. 
The easy way to get it is to store it into an array of strings and print the array of string backwards. You can do that by starting at the last part of the array down to the first letter.
3 0
2 years ago
Other questions:
  • Define the acronym WAECUP and its components
    15·1 answer
  • Can anyone help me with getting bash ubuntu on windows setup?
    15·1 answer
  • How does a spreadsheet affect a column of numerals when it sorts the column
    15·2 answers
  • For a wire with a circular cross section and a diameter = 3.00mm calculate the following: (m means meter. mm means millimeter. c
    5·1 answer
  • When looking at a relationship between two tables on an ERD, the _____ table can be identified by the presence of a foreign key
    8·1 answer
  • A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
    6·1 answer
  • Describe how the presence or absence of balance can affect a visitor’s perceptions of a Web page.
    7·1 answer
  • One of your start-ups uses error-correcting codes, which can recover the original message as long as at least 1000 packets are r
    8·1 answer
  • How did transistors revolutionize the world of computers?
    15·1 answer
  • Can anyone suggest me any good complete isekai anime..​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!