001-004-005

Variable Value Change: Age Calculator

Easy

Problem Description

variable Value Change: Age Calculator

In this problem, you will create a program that initializes an integer variable age to 10, updates it by adding 1 to calculate next year's age through variable reassignment, and displays the result to standard output.

Learning Objective: Learn how to update variable values

Overview

Values stored in variables can be changed later. Let's create a program that calculates current age and next year's age!

Specifications

  • Initialize integer variable age to 10
  • Output current age
  • Add 1 to age and update it
  • Output next year's age

Output Format

Current age: 10
Next year: 11

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