Question
Write a Java program that generates a two-dimensional array of size 5x5. Then it should fill the array with 25 random integer numbers (numbers range:
Write a Java program that generates a two-dimensional array of size 5x5. Then it should fill the
array with 25 random integer numbers (numbers range: between 241 and 524 inclusive). The
program should display the array elements, then it should convert any odd numbers in the array
to an even number by adding one to any odd number and display the array elements after the
conversion.
Output sample
The array elements are:
69 25 7 67 10
15 34 86 78 44
65 77 82 66 97
46 68 79 59 52
87 13 61 30 48
The array elements after converting any odd number to even number:
70 26 8 68 10
16 34 86 78 44
66 78 82 66 98
46 68 80 60 52
88 14 62 30 48
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started