Write a java program that declares an array to hold 12 integers.  The contents of the array should be the values 2,4,6,8,10,12,14,16,18,20,22,24.  Use a for-loop to initialize the contents of the array to these values. After initializing the array to these values, the program should display the contents of the array. Suggested output: The contents of the array is: Index Value 0   2 1   4 Etc…..

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question

Write a java program that declares an array to hold 12 integers.  The contents of the array should be the values 2,4,6,8,10,12,14,16,18,20,22,24.  Use a for-loop to initialize the contents of the array to these values. After initializing the array to these values, the program should display the contents of the array.

Suggested output:

The contents of the array is:

Index Value

0   2

1   4

Etc…..

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning