003-001-013

Compound Assignment Operators

Medium

Problem Description

Compound Assignment Operators

In this problem, you will create a program that initializes an integer variable value to 100, applies compound assignment operators (+=, -=, *=, /=) in sequence, and displays the result to standard output.

Learning Objective: Understand how to use compound assignment operators like +=, -=, *=, /=

Overview

Use compound assignment operators to efficiently update variable values.

Specifications

  • Initialize integer variable value with 100
  • Apply +=, -=, *=, /= in order and output value changes

Output Format

Initial: 100
After += 50: 150
After -= 30: 120
After *= 2: 240
After /= 4: 60

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up