Drag and drop the words to their places:
Map the scenario to its appropriate array type
To create a list of all prime numbers below 100
To store 5 marks of 3 students
2D ARRAY
1D ARRAY
Answers
Answer:
To create a list of all prime numbers below 100:1 D array
To store 5 marks of 3 students:2D array
Answer:
To create a list of all prime numbers below 100:- 1D ARRAY
To store 5 marks of 3 students:- 2D ARRAY
Explanation:
As we know, an array is a data structure that stores elements of same data type in a contiguous memory locations.
It is mainly of two types:
1. 1-D array also known as single dimension array is the type of array which stores elements as a list. It starts with the index 0.
Syntax in java - data-type [ ] name = new data-type [size];
2. 2-D or multi-dimensional array stores data in a row column format. It starts with the index [0][0].
Syntax in java - data-type [ ][ ] name = new data-type [rows][columns];
Here, we can store all prime numbers below 100 in a list format in a 1D array and we can store 5 marks of 3 students in a 2D array with 3 rows and 5 columns.
#SPJ3
To understand more about arrays, visit the below site:
https://brainly.in/question/13971324?msp_srt_exp=4
https://brainly.in/question/5900837?msp_srt_exp=4