For the operations on partially filled arrays below, provide the header ...

r6.14 For the operations on partially filled arrays below, provide the header of a func tion.

d. Remove all elements that are less than a given value.

Sol

a. void remove_items_less_than(int arr[], int size, int value)

P6.1 Write a program that initializes an array with ten random integers and then prints four lines of output, containing ? Every element at an even index. ? Every even element. ? All elements in reverse order. ? Only the first and last element.

Sol

#include #include

using namespace std;

int main() {

int randoms[10]; srand(time(0));

for (int i = 0; i < 10; i++) {

randoms[i] = (rand() % 100 + 1); }

cout ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download