Practice Paper: Array-Based Java Programs (ISC Style)
Question 1 (One-Dimensional Arrays)
Write a program to accept N integers in a one-dimensional array. Rearrange the array so
that all prime numbers come first in ascending order followed by all non-prime numbers in
descending order. Display the modified array.
Question 2 (One-Dimensional Arrays)
Accept an array of N positive integers. Generate a second array where each element is the
sum of digits of the corresponding element in the original array. Display both arrays.
Question 3 (Two-Dimensional Arrays)
Accept a square matrix of order N (N × N). Rotate the matrix 90 degrees clockwise without
using a second matrix. Display the original and the rotated matrix.
Question 4 (Two-Dimensional Arrays)
Accept a matrix of size M × N. For each row, replace every element with the difference
between the maximum and minimum values of that row. Display the modified matrix.
Question 5 (Mixed Array Operations)
Write a program to accept a one-dimensional integer array and count how many elements
are perfect numbers, Armstrong numbers, and palindrome numbers. Display the counts.
Question 6 (Two-Dimensional Arrays)
Accept a matrix of size M × N. Compute the sum of each column. Identify and print the
column with the highest sum.
Question 7 (One-Dimensional Arrays)
Accept N integers in an array. Create another array containing only the elements that
appear exactly once in the original array. Display the new array.
Question 8 (Two-Dimensional Arrays)
Accept a matrix of size M × N. Extract all boundary elements into a one-dimensional array
and display the boundary array.
Question 9 (One-Dimensional Arrays)
Accept two arrays A and B of size N. Create array C where C[i] contains the GCD of A[i] and
B[i]. Display the new array.
Question 10 (Two-Dimensional Arrays)
Accept an M × N matrix. Replace every even number with its half and every odd number
with its triple. Display the transformed matrix.