Unit4 - Subjective Questions

CSE101 • Practice Questions with Detailed Answers

1

Define an array in C. Explain the syntax for declaring and initializing a One-Dimensional (1D) array with examples.

2

Explain how elements of a 1D array are stored in memory. If the base address of an integer array is 1000 and the size of an integer is 2 bytes, calculate the address of .

3

Write a C program to find the sum and average of elements stored in an array.

4

Differentiate between One-Dimensional and Two-Dimensional arrays. Provide the syntax for declaring a 2D array.

5

Explain Row-Major and Column-Major ordering for storing 2D arrays. Derive the address calculation formula for Row-Major order.

6

Write a C program to perform Matrix Addition for two matrices.

7

Describe the mechanism of passing arrays to functions in C. How does passing a 1D array differ from passing a single variable?

8

Write a C program to multiply two matrices. Include checks for compatibility of matrix dimensions.

9

Explain the algorithm to insert an element into a specific position in a 1D array.

10

Write a function in C to delete an element from an array given its position.

11

What is Linear Search? Write a C program to implement Linear Search.

12

Explain the logic of Binary Search. What is the mandatory prerequisite for Binary Search? Calculate its Time Complexity.

13

Write a C program to implement Binary Search algorithm recursively or iteratively.

14

Compare Linear Search and Binary Search based on efficiency and requirements.

15

What is Bubble Sort? Explain its working principle with an example pass.

16

Write a C program to sort an array of integers in ascending order using Bubble Sort.

17

Trace the Bubble Sort algorithm for the input array: {64, 34, 25, 12, 22}. Show the array status after every pass.

18

Write a C program to find the Transpose of a given Matrix.

19

What are the advantages and limitations of using Arrays in C?

20

Write a C program to find the largest and smallest element in an array along with their indices.