001-002-010

Variables: Initialization and Value Update

Easy

Problem Description

Variables: Initialization and Value Update

Learning Objective: Understand variable initialization and value modification

Overview

Variables can be initialized with an initial value at declaration. Values can also be changed after assignment. Variable values are updated by assigning new values.

Specifications

Create a program that initializes an integer variable, updates its value, and outputs it.

  • Initialize variable count with 0
  • Output initial value
  • Add 10 to count (count = count + 10)
  • Output updated value
  • Add 5 to count
  • Output final value

Output Format

0
10
15

Ready to Try Running Code?

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

Don't have an account?