This repository contains solutions to common array operations and problems implemented in a clear and straightforward manner.
List of Programs
-
Declare and Print an Array Demonstrates how to declare an array and print its elements.
-
Input and Output Elements of an Array Takes input for array elements from the user and prints them.
-
Find the Sum of Elements in an Array Calculates the sum of all elements in the array.
-
Find the Average of Elements in an Array Computes the average (mean) of the array elements.
-
Find the Maximum Element Finds the largest element in the array.
-
Find the Minimum Element Finds the smallest element in the array.
-
Count Even and Odd Numbers Counts how many elements are even and how many are odd.
-
Print Elements at Even Indices Prints elements located at even indices (0, 2, 4, ...).
-
Print Elements at Odd Indices Prints elements located at odd indices (1, 3, 5, ...).
-
Count Positive and Negative Numbers Counts how many elements are positive and how many are negative.
-
Replace All Negative Numbers with Zero Modifies the array by replacing all negative numbers with zero.
-
Search an Element (Linear Search) Searches for a specific element in the array using linear search.
-
Copy an Array Creates a copy of the given array.
-
Reverse an Array Reverses the elements of the array.
-
Swap First and Last Elements Swaps the first and last elements of the array.
-
Print Array in Reverse Order Prints the array elements in reverse order without modifying the array.
-
Count Frequency of a Given Number Counts how many times a particular number appears in the array.
-
Find the Index of a Specific Element Finds the index of the first occurrence of a specific element.
-
Replace All Even Numbers with -1 Modifies the array by replacing all even numbers with -1.
-
Multiply All Elements of the Array Calculates the product of all elements in the array.