Loading...
Define a class to accept values into an integer array of order 4 x 4 and check whether it is a DIAGONAL array or not. An array is DIAGONAL if the sum of the left diagonal elements equals the sum of the right diagonal elements. Print the appropriate message. Example: 3 4 2 5 2 5 2 3 5 3 2 7 1 3 7 1 Sum of the left diagonal elements = 3 + 5 + 2 + 1 = 11 Sum of the right diagonal elements = 5 + 2 + 3 + 1 = 11
Define a class to accept values into a 4 x 4 integer array. Calculate and print the NORM of the array. NORM is the square root of sum of squares of all elements. 1 2 1 3 5 2 1 6 3 6 1 2 3 4 6 3 Sum of squares of elements = 1+4+1+9+25+4+1+36+9+36+1+4+9+16+36+9 = 201 NORM = Squareroot of 201 = 14.177446878757825
© 2026 PadhAiPro. This question is provided for educational purposes.