003-004-010

Basic Compound Assignment Operators

Easy

Problem Description

Basic Compound Assignment Operators

In this problem, you will create a program that uses compound assignment operators (+=, -=) to incrementally update the variable balance and displays the final balance to standard output.

Learning Objective: Understand how to use compound assignment operators (+=, -=)

Overview

Use compound assignment operators to efficiently update variable values.

Specifications

  • Initialize variable balance with 1000
  • Add 500 using the += operator
  • Subtract 200 using the -= operator
  • Output the final balance

Output Format

Balance: 1300

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