PROGRAM 2-DIMENSIONAL ARRAY (MATRIX)


Two-dimensional array is an array that has two subscripts of rows and columns. The number of elements that have two-dimensional array can be determined from the theoretical indeks1 * indeks2

eg: array A [2] [3] will have a 2 * 3 = 6 elements.

please understand and analysis the following programs, may be able to help her:

# include <iostream.h>
# include <conio.h>

void main () {
    int data [10] [10];
    int brs, klm, i, j;

   court <<"\ t \ tSlamet Islan Al Hidayah" <<endl;
   court <<"\ t \ t 10018075" <<endl;
   court <<endl;
   court <<"Program 2 Array Dimensions = matrix" <<endl;
   court <<endl;
   court <<"Number of Row =";
   cin>> brs;
   court <<"Number of Columns =";
   cin>> klm;

        court <<endl;
        for (i = 0; i <brs; i + +) {
        for (j = 0; j <klm; j + +) {
            court <<"The value of the matrix [" <<i +1 <<","<< j +1 <<"]:";
            cin>> data [i] [j];
            }
       }

       court <<endl;
       for (int i = 0; i <brs; i + +) {
       for (int j = 0; j <klm; j + +)
       court <<"" <<data [i] [j];
       court <<endl;
       }

getch ();
}
Output :

Well that's the program that I can make,,,,,!
If there are less jelass know any mistake, do not hesitate to leave a comment ataun advice. So that I can fix it later terimakasihh over his visit,,
Regards super ..

0 Response to " PROGRAM 2-DIMENSIONAL ARRAY (MATRIX) "