004-010-004
Multidimensional Array Dimensions: Getting Row and Column Count
Medium
Problem Description
Multidimensional Array Dimensions: Getting Row and Column Count
Learning Objective: Understand how to get row count and column count of 2D arrays
Overview
Create a program that gets and outputs the row and column count of a 2D array.
Specifications
- Create a 3x4 array
- Get row count with matrix.length
- Get column count with matrix[0].length
- Calculate total elements
Output Format
Rows: 3
Columns: 4
Total Elements: 12
Test Cases
※ Output examples follow programming industry standards
Input:
Expected Output:
Rows: 3 Columns: 4 Total Elements: 12
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
