What will be the output of the following code: int x = 10; x *= 3;?

  • x is assigned the value 0
  • x is assigned the value 10
  • x is assigned the value 13
  • x is assigned the value 30
In this code, x is first assigned the value 10, and then the compound assignment operator *= multiplies it by 3. So, x will be assigned the value 30. The other options are incorrect as they don't represent the correct result of the code.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *