Need help with this program. If you could also add comments to help me understan
ID: 3856254 • Letter: N
Question
Need help with this program. If you could also add comments to help me understand and study it, I would be very grateful. Thank you.
Write a program that will have 4 functions input an array print an array copy one array to another array in normal order void inputData( istream &, int [|, int) void printData( ostream &, const int [], int) void copyArray( const int orig], int dup], int) NOTE:De allocate memory for both arrays. Supply the data for the 1st array. Call the copyArray function int a[4] { 7, 14, 9, 10); int b[4] copyArray(a.b,4); printData(cout,b,4) THE OUTPUT WILL BE 14 10 The student should NOT create a local array inside the copyArray function. The reasons is that the local array inside the function only exists while the function is executing. After the function returns, all of the local memory is reclaimed. copy one array to another array in reverse order void revCopy( const int origll, int rev[, int) Write the main program to test the four functions you wroteExplanation / Answer
#include<iostream.h>
#include<conio.h>
void main()
{
int i,a[4],no, list[4];
clrscr();
inputData(cin, a[4], 4);
printData(cout, a[4], 4);
copyArray(a[4], list[4], 4);
}
void inputData(cin, int[], int){
// this is used to add data in the array
cout<<"Enter data in Array: ";
for(i=0;i<5;i++)
{
cin>>a[i];
}
}
void printData(cout, int[], int){
// this is used to print the data of an array
cout<<" Stored Data in Array: ";
for(i=0;i<4;i++)
{
cout<<a[i];
}
}
void copyArray(int[], int[], int){
// this is used to copy array
cout<<" New data in Array: ";
for(i=0;i<4;i++)
{
list[i]=a[i];
}
}
getch();
}
***Please provide the CF score by liking the answer. Thanks in advance.