+91-85006-22255
Write a program to find if the given matrix is a scalar matrix.
1 0 00 1 00 0 1
-3 0 0 00 -3 0 00 0 -3 00 0 0 -3
7 00 7
6 0 00 6 00 0 0
12 89 7723 99 6645 100 111
class IsScalarMatrix { public static void main(String s[]) { int input[][] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; System.out.println("The given matrix is a scalar matrix : " + isScalarMatrix(input)); } public static boolean isScalarMatrix(int matrix[][]) {
} }
Topic: Learn Arrays And Loops
Read this topic Take test on this topic
Open In App