Display Arrays

I am trying to display the following arrays.
int a[4]={5,9,2,10}
int b[3][3]={1,2,3,4,5,6,7,8,9}
int c[2][3][2]={1,2,3,4,5,6,7,8,9,10,11,12}

Using these call statements
Display (a,4);
Display(b,3);
Display(c,2);

I'm not sure on how to put this all together but this is what I have so far.

#include<iostream>
#include<iomanip>
#include<string>

using namespace std;


}
int a[4] = {5,9,2,10};
Display(a, 4);
void Display(int x[], int n)
{
for (int i = 0; i < n; ++i)
cout << x[i] << '\t';
}

int b[3][3] = { 1, 2, 3, 4, 5, 6,7,8,9 };
int total = Computetotal(b, 3)

int Computetotal(int x[][2], int n)
{
int t = o;
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < 2; ++j)
{
t += x[i][j];
}
}
return t;
}

int c[2][3][2] = { 1, 2, 3, 4, 5,6,7,8,9,10,11,12}
int total = Computetotal(c, 2)
int Computetotal(int x[][2][4], int n)
{
int t = 0;
for (i = 0; i < n; ++i)
{
for (int j = 0; j < 2; ++j)
{
for (int k = 0; k < 4; ++k)
{
t += c[i][j][k];
}
}
}
return t;
}
}
Topic archived. No new replies allowed.