Tech Study

List of Array in C++ Programs with Examples

Array is generally used when you have multiple values like multiple number s, multiple characters etc.

Example of Array in C++



C++ Array is a collection of variables belongings to the same data type. We can store group of data of same data type in an array.


  • int arr[10]; // integer array
  • char arr[10]; // character array i.e. string


Arrays are divided in two categories.

  • One-dimensional array
  • Multi-dimensional array

In this exercise we will focus on one-dimensional and multi-dimensional array. We will learn to implement and use arrays in C++ programming language using following examples.

  1. Write a C++ program to print all negative elements in an array
  2. Write C++ program to count total number of negative elements in array
  3. Write C++ program to read and print elements of array
  4. Write C++ program to find sum of all elements of an array
  5. Write C++ program to count even and odd elements in an array
  6. Write C++ program to find maximum and minimum element in array
  7. Write C++ program to insert an element in array
  8. Write C++ program to print all unique element in an array
  9. Write C++ program to sort an array in ascending order
  10. Write C++ program to copy all elements of one array to another
  11. Write C++ program to count number of each element in an array
  12. Write C++ program to delete all duplicate elements from an array
  13. Write C++ program count total duplicate elements in an array
  14. Write C++ program to merge two sorted array
  15. Write C++ program to put even and odd elements of array in two separate array
  16. Write C++ program to find reverse of an array
  17. Write C++ program to left rotate an array
  18. Write C++ program to right rotate an array

TaggedArray in C++c programsC++ Programs PracticeList of C++ language array programs with an examples

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more