Assume you are given an int variable named nElements and a 2-dimensional array that has been created and assigned to a2d. Write one or more

Question

Assume you are given an int variable named nElements and a 2-dimensional array that has been created and assigned to a2d. Write one or more statements that assign to nElements the total number of elements that could be stored in the entire 2-dimensional array.

in progress 0
Philomena 3 weeks 2021-08-26T19:04:33+00:00 1 Answers 0 views 0

Answers ( )

    0
    2021-08-26T19:05:53+00:00

    Answer:

    SEE EXPLAIN

    Explanation:

    public int dimension(int [][]a2d,int nElements)

    {

    int count = 0;

    for(int i = 0;i < a2d.length ; i++)

    {

    count = count + a2d[i].length;

    }

    return count;  

    }

Leave an answer

Browse

Giải phương trình 1 ẩn: x + 2 - 2(x + 1) = -x . Hỏi x = ? ( )