Array 1 dimensi menjadi Array 2 dimensi

#include<cstdlib>
#include<iostream>
Using name space
                Int main () {
                Int A [10]  = {0,1,2,3,4,5,6,7,8,9}
                Int B [10] [10]
                Cout <<”array 1 dimensi \n”;
                For (int i=0; i<9; i++) {
                Cout<< “ “ <<A [i];
                }
                Cout endl ;
                Cout<<”array 2 dimensi \n”;
                Int i=0
                While (i<9) {
                For (int j=0; j<3; j++) {
                For (int k=0; k<0; k<3; k++) {
                B [j] [k] : A[i]
                I++;
                }
                }             
                }
                For (int i=0; i<3; i++);
                For (int j=0; j<3; j++) {
                Cout<<” B [i] [j] <<” “;
                }
                Cout<<endl;
                System
}

Leave reply

Back to Top