shadowblackhear28081 shadowblackhear28081
  • 14-07-2019
  • Computers and Technology
contestada

What will the following code display?

int number = 6
int x = 0;
x = --number;
cout << x << endl;




1. 7

2. 6

3. 5

4. 0

Respuesta :

PhantomWisdom PhantomWisdom
  • 17-07-2019

Answer:

5

Explanation:

The operator '--number', it is a pre decrement operator which decrement first and then assign. It decrement the value by 1.

initially the number is 6.

x is 0.

then, x = --number;

it decrement the number by 1 first and then assign to x.

so, x assign the value 5.

finally, print the value.

Therefore, the answer is 5.  

Answer Link

Otras preguntas

Name these molecules. Number 8 is on top and 7 on bottom.
What do points do? And how many points do you need for the first rank?
(PLEASE HELP 25 POINTS) PLEASE HELP IT IS NOT BWhich circumstance led the Confederacy to think that it could purchase weaponry and supplies to use in the Civil
What is the mean of the data set? 108, 305, 252, 113, 191. Enter your answer in the box. please show the work step by step
Which expression can be used to find the value of x? a) 23(sin55°)(sin85°) b) 23(sin85°)sin55° c) 23(sin55°)sin85° d) (sin55°)(sin85°)23
In the girls' day out scenario, when janice shops with her group of friends, she restrains herself from her habit of bargaining. instead, she ends up buying exp
Which of the following is the product of the rational expressions shown below x+2/x-4•3x/x+4
When did most states in United States begin banning abortions?
What is W’X‘ ? 8 units, 10 units, 12 units, 14 units
How has the elimination of trade barriers affected the movement of goods among member countries of the European Union?