Write a program that reads a list of integer and stores the


Question:

Can you please assist me solving this Question by using C++ functions?

Part 1: Write a program that reads a list of integer and stores the integers in an array.

Part 2: Write a function compact that eliminates all zeroes from its array parameter, leaving the order of the other elements unchanged. All local variables within this function must be scalar.

In other words, you may not use a second array to solve the problem. The function also receives an integer parameter which represents the number of integer data stored in the array.

You must use the subsequent function header. void compact (int list[], int &N)// precondition: list contains integers from 0..N-1// postcondition: all 0's have been removed from list; N is reduced as appropriate.

Part 3: Do not solve the problem by printing out only the non-zero values in the array. Function compact must remove all zeroes from the array.

Prepare a Program to store the integers in array.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that reads a list of integer and stores the
Reference No:- TGS0957744

Expected delivery within 24 Hours