0% found this document useful (0 votes)
16 views1 page

C Array

The document provides examples of C++ programs to perform operations on arrays such as finding common elements, pairs with a given sum, checking equality, counting even and odd numbers, computing average excluding min and max, arranging signs, finding maximum product of two numbers, and checking if sorted.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

C Array

The document provides examples of C++ programs to perform operations on arrays such as finding common elements, pairs with a given sum, checking equality, counting even and odd numbers, computing average excluding min and max, arranging signs, finding maximum product of two numbers, and checking if sorted.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Ex1:  

Write a C++ program to find common elements between two arrays


Ex2: Write a C++ program to find all pairs of elements in an array whose sum is equal to a
specified number.
Ex3: Write a C++ program to test two arrays' equality.
Ex4: Write a C++ program to find the number of even and odd integers in a given array of
integers. 

Ex5: Write a C++ program to compute the average value of an array of integers except the
largest and smallest values. 

Ex6: Write a C++ program to arrange the elements of an array of integers so that all negative
integers appear before all positive integers.  
Ex7: Write a C++ program to find the maximum product of two integers in a given array of
integers.   

Example:
Input : 
nums = { 2, 3, 5, 7, -7, 5, 8, -5 }
Output: 
Pair is (7, 8), Maximum Product: 56

Ex8: Write a C++ program to check wether the elements of array is sorted or not.

You might also like