Write a Java program to implement a 5X5 integer array and print its diagonal elements. Take  the array elements from console (keyboard) during the program execution. You can use Scanner class.               Sample output: 25 81 6 -66 10

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 20VE
icon
Related questions
Question

Write a Java program to implement a 5X5 integer array and print its diagonal elements. Take
 the array elements from console (keyboard) during the program execution. You can use
Scanner class.   

           Sample output: 25 81 6 -66 10

Sample array:
25
3
80
9.
2
4
81
5
30
7
3
-4
6.
8
99
55
4
-66
48
71
84
97
10
Sample output: 25 81 6 -66 10
Transcribed Image Text:Sample array: 25 3 80 9. 2 4 81 5 30 7 3 -4 6. 8 99 55 4 -66 48 71 84 97 10 Sample output: 25 81 6 -66 10
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning