Untitled
Never
import java.util.Scanner; class Matrix { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter size of matrix"); int m = sc.nextInt(); int n = sc.nextInt(); double[][] matrix = new double[m][n]; int zeroCount = 0; System.out.println("Enter the elements of the matrix"); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { matrix[i][j] = sc.nextDouble(); if (matrix[i][j] == 0) { zeroCount++; } } } if (zeroCount > (m * n) / 2) { System.out.println("It is a sparse matrix"); } else { System.out.println("It is not a sparse matrix"); } } }
Raw Text
-
Adult Telegram Channels
1 hour ago
-
The Success Vitamin - Your Sales Trainer in India
1 hour ago
-
♥️♥️PEDOMON//PEDOSISTER♥️♥️
1 hour ago
-
Smart Hemp Cbd Gummies Australia (Best Pain Relief 2024 Scam)
2 hours ago
-
Pedowoman boy
2 hours ago
-
Russian tEE333ns
2 hours ago
-
P4CK M3G4 FIL3S T.I.E.R
2 hours ago
-
720GB CeePee
2 hours ago
-
( C H I L D P O R N )
2 hours ago
-
Candy Girls 🧬🧬🧬🧬
2 hours ago