004-002-013

Array Creation: Dynamic Size

Hard

Problem Description

Array Creation: Dynamic Size

Learning Objective: Understand how to dynamically determine array size using variables

Overview

Create a program that uses a variable value to determine array size.

Specifications

  • Assign value 7 to variable size
  • Create an integer array data using size
  • Output the array length
  • Output the first and last element indices

Output Format

Array created with size: 7
First index: 0
Last index: 6

Ready to Try Running Code?

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

Don't have an account?