KEMBAR78
Array C++ | PDF | Science & Mathematics | Computers
0% found this document useful (0 votes)
55 views1 page

Array C++

The document provides instructions for writing several C++ programs to perform operations on arrays, including finding the largest/largest three elements, sorting arrays in wave or zig-zag patterns, separating 0s and 1s, rearranging arrays based on maximum/minimum values, and sorting an array based on absolute differences from a given value.

Uploaded by

Tahir Javed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views1 page

Array C++

The document provides instructions for writing several C++ programs to perform operations on arrays, including finding the largest/largest three elements, sorting arrays in wave or zig-zag patterns, separating 0s and 1s, rearranging arrays based on maximum/minimum values, and sorting an array based on absolute differences from a given value.

Uploaded by

Tahir Javed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Write a C++ program to find the largest element of a given array of integers.

2. Write a C++ program to find the largest three elements in an array.

3. Write a C++ program to find the second largest element in an array of integers.

Write a C++ program to sort a given unsorted array of integers, in wave form.
Note: An array is in wave form when array[0] >= array[1] <= array[2] >= array[3] <=
array[4] >= . . . .

Write a C++ program to rearrange the elements of a given array of integers in a


zig-zag pattern.

14. Write a C++ program to separate 0s and 1s from a given array of values 0 and 1.

Write a C++ program to rearrange a given sorted array of positive integers .


Note: In final array, first element should be maximum value, second minimum value,
third second maximum value , fourth second minimum value, fifth third maximum and
so

. Write a C++ program to sort (in descending order) an array of distinct elements
according to the absolute difference of array elements and with a given value.

You might also like