Important Introduction to Programming Short Questions
Chapter: 13
Question 1:
What is an array?
Answer:
An array is a collection of identical or similar values stored in a structured way, often used to store multiple values of similar data.
Chapter: 13
Question 2:
Why are height and age not stored in the same array?
Answer:
Height and age are contextually different data types, so they should be stored in separate arrays for clarity and logical separation.
Chapter: 13
Question 3:
How do we typically process elements in an array?
Answer:
We use loops to process elements in an array, iterating through each element, starting with the first and moving to the last.
Chapter: 13
Question 4:
How do we process a two-dimensional array of numbers?
Answer:
A two-dimensional array is processed by treating it as a matrix with rows and columns, iterating through each row and column using nested loops.
Chapter: 13
Question 5:
How do you access an element in a two-dimensional array?
Answer:
You access an element in a two-dimensional array using a[row_index][column_index]. For example, a[1][2] accesses the element at row 1, column 2.
Chapter: 13
Question 6:
What does the '\t' character do in the code?
Answer:
The '\t' character inserts a tab space at the cursor's current position on the screen, helping in formatting the output.
Chapter: 13
Question 7:
What is the purpose of the flow chart given in the context?
Answer:
The flow chart provides a visual representation of the logic to read and then display elements of a two-dimensional array in reverse row order.
Chapter: 13
Question 8:
What is the flipping of a matrix?
Answer:
Flipping a matrix refers to reversing the order of rows in a two-dimensional array while keeping the columns in the same order.
Chapter: 13
Question 9:
Why do we need a swapping mechanism during the transpose of a matrix?
Answer:
A swapping mechanism is necessary during the transpose of a matrix to correctly interchange rows and columns without losing original data.
Chapter: 13
Question 10:
What happens if you process the entire matrix during transpose without restricting the range of columns?
Answer:
The elements will be swapped back to their original positions, resulting in no change in the matrix.