004-005-011

Array Initialization with new

Medium

Problem Description

Array Initialization with new

Learning Objective: Understand array initialization using the new operator

Overview

Create an array with a specified size using new operator and set values afterwards.

Specifications

  • Create an int array of size 3 using new
  • Assign 100 to index 0, 200 to index 1, 300 to index 2
  • Output each element

Output Format

100
200
300

Ready to Try Running Code?

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

Don't have an account?