Question: Write a program in Java to store 10 different numbers in Single Dimensional Array, split the array into two separate arrays. One arrays contains
Write a program in Java to store 10 different numbers in Single Dimensional Array, split the array into two separate arrays. One arrays contains all prime numbers in ascending order while the other array contains all the even numbers in descending order. ( 2 should be grouped with prime numbers and while inserting a number in the array insert at it appropriate location according to its value) SAMPLE INPUT: 130,32,54,2,42,87,19,176,199,31 OUTPUT: First Array : 2,19,31,199 Second Array: 176,130,54,42,32
Step by Step Solution
3.35 Rating (158 Votes )
There are 3 Steps involved in it
Heres a Java program that implements the described functionality To change this l... View full answer
Get step-by-step solutions from verified subject matter experts
