Question: Write a program to take input of positive integer numbers greater than zero in a 2D array A[][] of order n. Find the sum
Write a program to take input of positive integer numbers greater than zero in a 2D array A[][] of order n. Find the sum and frequency of even and odd numbers in the 2D array. Also swap the elements of left and right diagonal. Print the result in the following format n=3 2 4 5 8 9 1 635 Sum of even numbers=2+4+8+6=20 Sum of odd numbers=5+9+1+3+5=23 Matrix after swapping the diagonal elements 542 891 536 Frequency of even numbers=4 Frequency of odd numbers=5 Activate Windows Go to Settings to activate Windows.
Step by Step Solution
There are 3 Steps involved in it
Heres a Java program that takes input of positive integer numbers greater than zero in a 2D array ca... View full answer
Get step-by-step solutions from verified subject matter experts
