Write the definition of a function printArray, which has two parameters. The first parameter is an array of integers and the second is an int, the number of elements in the array. The function does not return a value. The function prints out each element of the array, on a line by itself, in the order the elements appear in the array, and does not print anything else.
.
.
Click on the title for the solution
.
.
void printArray(int a[],int n)
{
int i;
for (i=0;i<n;i++)
{cout<<a[i]<<endl;}}
.
Click on the title for the solution
.
.
This is the answer:
:
void printArray(int a[],int n)
{
int i;
for (i=0;i<n;i++)
{cout<<a[i]<<endl;}}
Comments
Post a Comment