Skip to content

perform various operations on an array based on user input

Notifications You must be signed in to change notification settings

osiBadir19/Array-Operations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Array Operations in C

This C program allows you to perform various operations on an array based on user input. It provides options to print the array, calculate its sum, copy it, find maximum and minimum elements, sort it in ascending or descending order, merge it with another array, and more.

Table of Contents

Overview

This program demonstrates common operations that can be performed on arrays in C. It provides a menu-driven interface where the user can choose from different operations to manipulate and analyze arrays.

Operations

The program supports the following operations:

  • Print Array: Display the elements of the array.
  • Print Array (Reversed): Display the elements of the array in reverse order.
  • Calculate Array Sum: Compute the sum of all elements in the array.
  • Copy Array: Create a copy of the array.
  • Frequency of Elements: Calculate the frequency of each element in the array.
  • Print Unique Elements: Display elements that appear only once in the array.
  • Sort Array (Ascending): Sort the array in ascending order.
  • Sort Array (Descending): Sort the array in descending order.
  • Find Maximum Element: Identify and print the maximum element in the array.
  • Find Minimum Element: Identify and print the minimum element in the array.
  • Merge Two Arrays: Combine two arrays of the same length into a single array.

Functions

The program includes the following functions to implement array operations:

  • ArrayCreate: Populate an array with user-provided values.
  • ArrayPrint: Print the elements of an array.
  • ArrayPrintReversed: Print the elements of an array in reverse order.
  • ArraySum: Calculate the sum of elements in an array.
  • ArrayCopy: Copy elements from one array to another.
  • ArrayFreqOfElements: Display the frequency of each element in an array.
  • ArrayPrintUnique: Print elements that are unique in the array.
  • MergeTwoArrays: Merge two arrays of the same length into a third array.
  • ArraySort: Sort an array in ascending order.
  • ArrayReverseSort: Sort an array in descending order.
  • MaxElement: Find and return the maximum element in an array.
  • MinElement: Find and return the minimum element in an array.

This program serves as an educational tool to understand and practice fundamental array operations in C programming language.

About

perform various operations on an array based on user input

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages