Question
a. a function to add all numbers i an integer array
b. a function to remove all odd numbers from an ordered array. The array should remain ordered.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
int * add(int size);void removeOddNumberFromOrderedArray(int *& orderedArray, int & size);
int main(int argc, char** argv) {
int size = 3;
int * a = add(size);
cout<<"Array content \n";
for (int i = 0; i < size; i++) {
cout<<*(a + i)<<" ";
}
cout<<"\n";
size = 10;
int * b = new int [size];
for (int i = 0; i < size; i++) {
*(b + i) = i;
}
cout<<"before remove odd number\n";
for (int i = 0; i < size; i++) {
cout<<*(b + i)<<" ";
}
cout<<"\n";
removeOddNumberFromOrderedArray(b,size);...