Skip to content

Cyphercall/Java_Array_Programs

Repository files navigation

Java_Array_Programs

Array Programming Tasks

This repository contains solutions to common array operations and problems implemented in a clear and straightforward manner.

List of Programs

  1. Declare and Print an Array Demonstrates how to declare an array and print its elements.

  2. Input and Output Elements of an Array Takes input for array elements from the user and prints them.

  3. Find the Sum of Elements in an Array Calculates the sum of all elements in the array.

  4. Find the Average of Elements in an Array Computes the average (mean) of the array elements.

  5. Find the Maximum Element Finds the largest element in the array.

  6. Find the Minimum Element Finds the smallest element in the array.

  7. Count Even and Odd Numbers Counts how many elements are even and how many are odd.

  8. Print Elements at Even Indices Prints elements located at even indices (0, 2, 4, ...).

  9. Print Elements at Odd Indices Prints elements located at odd indices (1, 3, 5, ...).

  10. Count Positive and Negative Numbers Counts how many elements are positive and how many are negative.

  11. Replace All Negative Numbers with Zero Modifies the array by replacing all negative numbers with zero.

  12. Search an Element (Linear Search) Searches for a specific element in the array using linear search.

  13. Copy an Array Creates a copy of the given array.

  14. Reverse an Array Reverses the elements of the array.

  15. Swap First and Last Elements Swaps the first and last elements of the array.

  16. Print Array in Reverse Order Prints the array elements in reverse order without modifying the array.

  17. Count Frequency of a Given Number Counts how many times a particular number appears in the array.

  18. Find the Index of a Specific Element Finds the index of the first occurrence of a specific element.

  19. Replace All Even Numbers with -1 Modifies the array by replacing all even numbers with -1.

  20. Multiply All Elements of the Array Calculates the product of all elements in the array.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages