Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <mem.h>
- #include <stdlib.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv) {
- int **A, **B, **C;
- int JlhBrs, JlhKlm, brs, klm;
- printf("Masukkan jumlah baris: "); scanf("%i", &JlhBrs);
- printf("Masukkan jumlah kolom: "); scanf("%i", &JlhKlm);
- A=new int*[JlhBrs];
- B=new int*[JlhBrs];
- C=new int*[JlhBrs];
- for (brs=0; brs<JlhBrs; brs++) {
- A[brs]=new int[JlhKlm];
- B[brs]=new int[JlhKlm];
- C[brs]=new int[JlhKlm];
- }
- printf("Matrix A:\n");
- for(brs=0; brs<JlhBrs; brs++) {
- for(klm=0; klm<JlhKlm; klm++) {
- A[brs][klm]=rand()%100;
- printf("%2i ", A[brs][klm]);
- }
- printf("\n");
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement