fake3447 fake3447
  • 15-01-2020
  • Computers and Technology
contestada

What value will be assigned to the answer variable as a result of the statement: answer = 3 + 2 * 4 % (2 + 4)A. 2B. 4C. 5D. 10

Respuesta :

Debel
Debel Debel
  • 16-01-2020

Answer:

5

Explanation:

The order of execution is very important in solving the question

( ) - first

* and % operator takes the same amount of precedence then you consider the order from left to right

then + last

3 + 2 * 4 % (2 + 4) = 3 + 2 * 4 % 6 = 3 + 8 % 6 = 3 + 2 = 5

So 5 is the value that will be assigned to the answer variable

Note:

8 % 6 is the remainder of 8/6 which is 2.

Answer Link

Otras preguntas

Please answer these that i circled. If you cant see them tell me. Tell me the ones you can see.
La mama de Marta sembrara tulipanes
The weight of an object is the product of its mass, m, and the acceleration of gravity, g (where g=9.8 m/s2). If an object’s mass is m=10. kg, what is its weigh
Please Help!!!! I Give Thanks!!!!
how can you describe anatomy
I had 1/8 books plus 1/5 books , how many total ?
Which form of government, practiced in certain Greek city-states and in Persian empire describe a society ruled by a king or queen until his or her death at whi
Which value of a from the set {16, 18, 20, 22} makes the equation 2(42 - a) = 48 true?
if the US had been poor in natural resources how would industrialization has been affected
When glucose and fructose join together, what do they form?