2-d array- c programdefine a two dimension array


2-D Array- C program:

Define a two dimension array using c.

void convert ( int a[10][10] , int[] , int , int);

void main()

  {

  clrscr();

  int a[10][10], b[100], n, m, i, j;

  cout<<"enter the number of rows of the array : ";

  cin>>n;

  cout<<"enter the number of columns of the array : ";

  cin>>m;

  for (i=0;i

                {

                for(j=0;j

                                {

                                cout<<"enter element "<

                                cin>>a[i][j];

                                }

                }

  convert (a,b,n,m);

  cout<

  cout<<"the converted array is :"<

  for(i=0;i<(m*n);i++)

                {

                cout<

                }

  getch();

  }

  void convert (int a[10][10] , int b[100] , int n , int m)

                {

  int i,j,k=0;

  for(i=0;i

                {

                for(j=0;j

                                {

                                b[k]=a[i][j];

                                k++;

                                }

                }

  }

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: 2-d array- c programdefine a two dimension array
Reference No:- TGS0174878

Expected delivery within 24 Hours