SlideShare a Scribd company logo
Pertemuan 1 - Algoritma dan Struktur Data 1
Two Dimensional
Array
Pengertian array dua dimensi
Array dua dimensi dapat dipandang sebagai gabungan array satu dimensi
Pandanglah tiga buah array satu dimensi yang dibuat dengan int A1[5], int
A2[5], int A3[5].
Ketiga buah array satu dimensi diatas, dapat digabung menjadi satu, sehingga
terbentuk sebuah array yang disebut array dua dimensi yang biasanya
diilustrasikan sebagai berikut :
Array 1 Dimensi :
char A[5] ;
Array 2 Dimensi :
char A[3][5] ;
Isinya ada
Tapi tidak diketahui
Isinya ada
Tapi tidak diketahui
Array 1 Dimensi :
char A[5] ;
0 1 2 3
4
Array 2 Dimensi :
char A[3][5] ;
0 1 2 3
4
0
1
2
Jumlah
kolom
( column )
Jumlah kolom
Jumlah baris
( row )
Nomor
Kolom
( index )
Nomor
kolom
Nomor
baris
Array 1 Dimensi :
char A[5] ;
0 1 2 3
4
Array 2 Dimensi :
char A[3][5] ;
0 1 2 3
4
0
1
2
Jumlah kolom
Jumlah kolom
Jumlah baris
Nomor
kolom
Nomor
kolom
Nomor
baris
Isinya ada
Tapi tidak diketahui
Isinya ada
Tapi tidak diketahui
Array 2 Dimensi :
char A[3][5]
;
Sering disebut
array 3 x 5
Array 1 Dimensi :
char A[5] =
{‘A’,’B’,’C’,’D’,’E’} ;
A B C D E
0 1 2 3
4
Array 2 Dimensi :
char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’ ,
‘K’,’L’,’M’,’N’,’O } ;
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
Array
2 Dimensi
Contoh - 1
#include<stdio.h>
void main()
{ char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[1][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
baris : 1
kolom : 2
Dev C++ 5.11
Contoh - 1
#include<stdio.h>
void main()
{ char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[1][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
H
Dev C++ 5.11
Array 2 Dimensi :
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
Dev C++ 5.11
H
#include<stdio.h>
void main()
{ char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[1][2] );
}
#include<stdio.h>
void main()
{ char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[1][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
DIULANG
Apa yang tercetak ?
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[1][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
H
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[2][3] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
Apa yang tercetak ?
Kalau ini : ?
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[1][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
N
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[3][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
Apa yang tercetak ?
Kalau ini : ?
3
Apakah
Error ?
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
printf(" %c ", A[3][2] );
}
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
. Tercetak karakter
sembarang sesuai
dengan karakter
apa yang ada pada
lokasi tersebut saat itu
TIDAK
ERROR
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
char A[3][5];
A[0][0]
A[0][2]
A[1][3]
?
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
char A[3][5];
A[0][0]
A[0][2]
A[1][3]
A[2][1]
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
char A[3][5];
A[0][0]
A[0][2]
A[1][3]
A[2][1]
Pertemuan 1 - Algoritma dan Struktur Data 1
0 1 2 3
4
A B C D E
F G H I J
K L M N 0
0
1
2
char A[3][5];
i j
0 0
0 1
0 2
0 3
0 4
1 0
1 1
1 2
1 3
1 4
2 0
2 1
2 2
2 3
2 4
i
j
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
Array 2 Dimensi :
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
Logical
illustration
3 baris
5 kolom
A B C D E
0,0 0,1 0,2 0,3 0,4 1,0 1,1 1,2 1,3 1,4 2,0 2,1 2,2 2,3 2,4
F G H I J K L M N 0
memory physical allocation
secara fisik alamatnya contiguous
2,4
untuk
menyatakan
A[2][4]
Array 2 Dimensi :
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
char A[3][5] = { 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N',
'O' } ;
char A[3][5] = { 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L',
'M', 'N', 'O' } ;
atau :
atau :
char A[3][5] = { ‘A’,’B’,’C’,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,
} ;
A B C 0 0
0 1 2 3
4
F G H I J
K L 0 0 0
0
1
2
0 (NULL)
0 0 0 0 0 0 0 0
Karakter NULL
semua bit-nya 0 (nol)
Kalau dicetak dengan ;
“ %c ” tercetak : spasi (blank
“ %i “ tercetak : 0 (nol)
“ %x “ tercetak : 00
A 0 0 0 0
0 1 2 3
4
0 0 0 0 0
0 0 0 0 0
0
1
2
char A[3][5] = { ‘A’
} ;
char A[3][5] = { 65
} ;
atau :
atau :
char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’
,
‘F’,’G’,’H’,’I’,’J’ ,
‘K’,’L’,’0’,’N’,’O’ } ;
0 1 2 3
4
A B C D E
F G H I J
K L 0 N 0
0
1
2
NULL
char A[3][5] = { "ABCDE" ,
"FGHIJ"
,
"KL
NO" } ;
0 1 2 3
4
A B C D E
F G H I J
K L N 0
0
1
2
space
space
Pertemuan 1 - Algoritma dan Struktur Data 1
0 0 0 0 0 0 0 0
Karakter NULL
Kalau dicetak dengan :
“ %c ” tercetak : spasi (blank)
“ %i “ tercetak : 0 (nol)
“ %x“ tercetak : 00
0 0 1 0 0 0 0 0
Karakter space
Kalau dicetak dengan ;
“ %c ” tercetak : spasi (blank)
“ %i “ tercetak : 32
“ %x “ tercetak : 20
Contoh - 2
Contoh - 2
#include<stdio.h>
main()
{ int A[3][5] =
{ 5,12,17,10,7,
15,6,25,2,19,
4,9,20,22,11 };
printf(" %c ", A[1][2] );
return 0;
}
0 1 2 3
4
5 12 17 10 7
15 6 25 2 19
4 9 20 22 11
0
1
2
Dev C++ 5.11
Apa yang tercetak : ?
Contoh - 2
#include<stdio.h>
void main()
{ int A[3][5] =
{ 5,12,17,10,7,
15,6,25,2,19,
4,9,20,22,11 };
printf(" %c ", A[1][2] );
}
0 1 2 3
4
5 12 17 10 7
15 6 25 2 19
4 9 20 22 11
0
1
2
Dev C++ 5.11
25
int A[3][5] =
{ 5,12,17,10,7,
15,6,25,2,19,
4,9,20,22,11 };
int A[3][5] = { 5,12,17,10,7,
15,6,25,2,19,
4,9,20,22,11 };
int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19,
4,9,20,
22,11 };
int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19,
0 1 2 3
4
5 12 17 10 7
15 6 25 2 19
4 9 20 22 11
0
1
2
atau :
atau :
atau :
int A[3][5] = { 5,12,17,10,7,
15,6,25,
2,19,4,9,
20,
22,11 };
atau :
int A[3][5] =
{ 5,12,17,10,7,
15,6,25,2,19,
4,9, } ;
0 1 2 3
4
5 12 17 10 7
15 6 25 2 19
4 9 0 0 0
0
1
2
Lokasi yang
tidak diisi,
otomatis diisi
dengan 0 (nol)
Hanya diisi
12 elemen
3 elemen
terakhir
tidak diisi
int A[3][5] =
{ 5,12,17,10,7,
15,6,25,2,19,
4,9, } ;
0 1 2 3
4
5 12 17 10 7
15 6 25 2 19
4 9 0 0 0
0
1
2
int A[3][5] = { 1, 2, 3, 4, 5,
6, 7, 8,
9,10,
11,12,13,14,15,16 } ;
ERROR
maksimu
m 15
elemen
Contoh - 3
Dev C++ 5.11
#include<stdio.h>
void main()
{char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
j=2;
{ printf( "%c ", A[0] [ j ] );
}
}
Apa yang tercetak : ?
Contoh – 3a
Borland Turbo-C++ A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
j=2;
{ printf( "%c ", A[0] [ j ] );
}
}
Apa yang tercetak : ?
Contoh – 3a
Borland Turbo-C++ A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
j=2;
{ printf( "%c ", A[0] [ j ] );
}
}
Contoh – 3a
C
Contoh - 4
Dev C++ 5.11
#include<stdio.h>
void main()
{char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
for( j=0; j<=4; j++ )
{ printf( "%c ", A[0] [ j ] );
}
}
Apa yang tercetak : ?
Contoh – 4
Dev C++ 5.11 A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
for( j=0; j<=4; j++ )
{ printf( "%c ", A[0] [ j ] );
}
}Apa yang tercetak : ?
Contoh – 4
j
elemen
yang isinya
dicetak
0
1
2
3
4
A[0][0]
A[0][1]
A[0][2]
A[0][3]
A[0][4]
Dev C++ 5.11 A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
for( j=0; j<=4; j++ )
{ printf( "%c ", A[0] [ j ] );
}
}
Contoh – 4
j
elemen
yang isinya
dicetak
0
1
2
3
4
A[0][0]
A[0][1]
A[0][2]
A[0][3]
A[0][4]
A B C D E
Dev C++ 5.11
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int j;
for( …………………… )
{ …………………………… );
}
}A B C D E
Contoh – 4
Tulis ulang !
supaya tercetak :
A B C D E
Pertemuan 1 - Algoritma dan Struktur Data 1
Contoh - 5
#include<stdio.h>
void main( )
{char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’
,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i;
for( i=0; i<=2; i++ )
{ printf( "%c ", A[i][0]);
}
}
Dev C++ 5.11
Contoh - 5
Apa yang tercetak : ?
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main( )
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i;
for( i=0; i<=2; i++ )
{ printf( "%c ", A[i][0]);
}
}
Dev C++ 5.11
Contoh - 5
Apa yang tercetak : ?
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main( )
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i;
for( i=0; i<=2; i++ )
{ printf( "%c ", A[i][0]);
}
}
Dev C++ 5.11
Contoh - 5
i
elemen
yang isinya
dicetak
0
1
2
A[0][0]
A[1][0]
A[2][0]
Apa yang tercetak : ?
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main( )
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i;
for( i=0; i<=2; i++ )
{ printf( "%c ", A[i][0]);
}
} A F K
Borland Turbo-C++
Contoh - 5
i
elemen
yang isinya
dicetak
0
1
2
A[0][0]
A[1][0]
A[2][0]
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
#include<stdio.h>
void main( )
char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i;
for( ……………………)
{ ……………………………..);
}
}
Borland Turbo-C++
Contoh - 5
i
elemen
yang isinya
dicetak
0
1
2
A[0][0]
A[1][0]
A[2][0]Tulis ulang !
supaya tercetak :
A F K
Pertemuan 1 - Algoritma dan Struktur Data 1
Contoh - 6
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Dev C++ 5.11Contoh - 6
Apa yang tercetak : ?
Tulis !
Apa yang
tercetak
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Dev C++ 5.11Contoh - 6
Apa yang tercetak : ?
i j
0 1
2
3
4
1 1
2
3
4
2 1
2
3
4
#include<stdio.h>
void main()
{char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Dev C++ 5.11Contoh - 6
Apa yang tercetak : ?
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
urutan
proses
#include<stdio.h>
void main()
{ char A[3][5]={ "ABCDE" ,
"FGHIJ" ,
"KLMNO" };
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
Apa yang tercetak : ?
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
Apa yang tercetak : ?
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
Tercetak :
A B C D E
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
Apa yang tercetak : ?
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
Tercetak :
F G H I J
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
Apa yang tercetak : ?
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
Tercetak :
K L M N O
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
Apa yang tercetak : ?
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
Tercetak :
A B C D E
F G H I J
K L M N O
#include<stdio.h>
void main()
char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for( i=0; i<=2; i++ )
{ for( j=0; j<=4; j++)
{ printf("%c ", A[i][j]);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
A B C D E
F G H I J
K L M N O
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(………………… )
{ for( …………………….)
{…………………………);
}
printf("n");
}
}
Borland Turbo-C++Contoh - 6
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
i j
0 0
1
2
3
4
1 0
1
2
3
4
2 0
1
2
3
4
Tulis ulang,
untuk mencetak :
ABC D E
FGH I J
KLMNO
Contoh - 7
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
Apa yang tercetak : ?
Tulis !
Apa yang
tercetak
#include<stdio.h>
void main()
{char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’
,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}Apa yang tercetak : ?
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
urutan
proses
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
Tercetak :
A F K
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
Tercetak :
B G L
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
Tercetak :
C H M
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
Tercetak :
D I N
#include<stdio.h>
void main()
{char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
Tercetak :
E J O
#include<stdio.h>
void main()
char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
AF K
BGL
CHM
D I N
EJ O
Tercetak :
A F K
B G L
C H M
D I N
E J O
#include<stdio.h>
void main()
char A[3][5] =
{ ‘A’,’B’,’C’,’D’,’E’ ,
‘F’,’G’,’H’,’I’,’J’,
‘K’,’L’,’M’,’N’,’O’ } ;
int i, j;
for(j=0; j<=4; j++ )
{ for( i=0; i<=2; i++)
{ printf("%c",A[ i][ j ]);
}
printf("n");
}
}
j i
0 0
1
2
1 0
1
2
2 0
1
2
3 0
1
2
4 0
1
2
A B C D E
0 1 2 3
4
F G H I J
K L M N 0
0
1
2
i
j
[ 0 ] [ 0 ]
[ 1 ] [ 0 ]
[ 2 ] [ 0 ]
[ 0 ] [ 1 ]
[ 1 ] [ 1 ]
[ 2 ] [ 1 ]
[ 0 ] [ 2 ]
[ 1 ] [ 2 ]
[ 2 ] [ 2 ]
[ 0 ] [ 3 ]
[ 1 ] [ 3 ]
[ 2 ] [ 3 ]
[ 0 ] [ 4 ]
[ 1 ] [ 4 ]
[ 2 ] [ 4 ]
[ 0 ] [ 0 ]
[ 1 ] [ 0 ]
[ 2 ] [ 0 ]
[ 0 ] [ 1 ]
[ 1 ] [ 1 ]
[ 2 ] [ 1 ]
----
----
[ 2 ] [ 4 ]
A F K
BG L
CHM
D I N
EJ O
Pertemuan 1 - Algoritma dan Struktur Data 1
Ad

More Related Content

What's hot (20)

Tabel ascii terlengkap
Tabel ascii terlengkapTabel ascii terlengkap
Tabel ascii terlengkap
Lela Warni
 
Array dan Contoh
Array dan ContohArray dan Contoh
Array dan Contoh
Agung Firdausi Ahsan
 
Recursion in Python
Recursion in PythonRecursion in Python
Recursion in Python
Fariz Darari
 
3 Linked List
3   Linked List3   Linked List
3 Linked List
ahmad haidaroh
 
Algoritma dan Pemrograman C++ (Perulangan)
Algoritma dan Pemrograman C++ (Perulangan)Algoritma dan Pemrograman C++ (Perulangan)
Algoritma dan Pemrograman C++ (Perulangan)
Nabil Muhammad Firdaus
 
CFG dan PARSING - P 5 - Teknik Kompilasi
CFG dan PARSING - P 5 - Teknik KompilasiCFG dan PARSING - P 5 - Teknik Kompilasi
CFG dan PARSING - P 5 - Teknik Kompilasi
ahmad haidaroh
 
Tutorial solidworks membuat rangka meja menggunakan weldment
Tutorial solidworks membuat rangka meja menggunakan weldmentTutorial solidworks membuat rangka meja menggunakan weldment
Tutorial solidworks membuat rangka meja menggunakan weldment
Zul Abidin
 
Kriptografi dalam kehidupan sehari hari
Kriptografi dalam kehidupan sehari hariKriptografi dalam kehidupan sehari hari
Kriptografi dalam kehidupan sehari hari
likut101010
 
Sorting
SortingSorting
Sorting
Zezen Wahyudin
 
Cara Menghitung Minterm
Cara Menghitung MintermCara Menghitung Minterm
Cara Menghitung Minterm
Mimikri Dony
 
Algoritma brute force
Algoritma brute forceAlgoritma brute force
Algoritma brute force
Vocational High School 3 Tegal
 
Modul Microsoft Excel 2013.pdf
Modul Microsoft Excel 2013.pdfModul Microsoft Excel 2013.pdf
Modul Microsoft Excel 2013.pdf
MISDEC
 
8. Multi List (Struktur Data)
8. Multi List (Struktur Data)8. Multi List (Struktur Data)
8. Multi List (Struktur Data)
Kelinci Coklat
 
Sql (4)
Sql (4)Sql (4)
Sql (4)
Fariszal Nova
 
2700 3 data preprocessing
2700 3 data preprocessing2700 3 data preprocessing
2700 3 data preprocessing
Universitas Bina Darma Palembang
 
Algoritma dan Struktur Data - Methods
Algoritma dan Struktur Data - MethodsAlgoritma dan Struktur Data - Methods
Algoritma dan Struktur Data - Methods
KuliahKita
 
Laporan Praktikum Web dengan PHP
Laporan Praktikum Web dengan PHPLaporan Praktikum Web dengan PHP
Laporan Praktikum Web dengan PHP
Okta Riveranda
 
Laporan hasil praktikum modul i pengenalan pascal
Laporan hasil praktikum modul i pengenalan pascalLaporan hasil praktikum modul i pengenalan pascal
Laporan hasil praktikum modul i pengenalan pascal
Meycelino A. T
 
Tabel ascii terlengkap
Tabel ascii terlengkapTabel ascii terlengkap
Tabel ascii terlengkap
Lela Warni
 
Recursion in Python
Recursion in PythonRecursion in Python
Recursion in Python
Fariz Darari
 
Algoritma dan Pemrograman C++ (Perulangan)
Algoritma dan Pemrograman C++ (Perulangan)Algoritma dan Pemrograman C++ (Perulangan)
Algoritma dan Pemrograman C++ (Perulangan)
Nabil Muhammad Firdaus
 
CFG dan PARSING - P 5 - Teknik Kompilasi
CFG dan PARSING - P 5 - Teknik KompilasiCFG dan PARSING - P 5 - Teknik Kompilasi
CFG dan PARSING - P 5 - Teknik Kompilasi
ahmad haidaroh
 
Tutorial solidworks membuat rangka meja menggunakan weldment
Tutorial solidworks membuat rangka meja menggunakan weldmentTutorial solidworks membuat rangka meja menggunakan weldment
Tutorial solidworks membuat rangka meja menggunakan weldment
Zul Abidin
 
Kriptografi dalam kehidupan sehari hari
Kriptografi dalam kehidupan sehari hariKriptografi dalam kehidupan sehari hari
Kriptografi dalam kehidupan sehari hari
likut101010
 
Cara Menghitung Minterm
Cara Menghitung MintermCara Menghitung Minterm
Cara Menghitung Minterm
Mimikri Dony
 
Modul Microsoft Excel 2013.pdf
Modul Microsoft Excel 2013.pdfModul Microsoft Excel 2013.pdf
Modul Microsoft Excel 2013.pdf
MISDEC
 
8. Multi List (Struktur Data)
8. Multi List (Struktur Data)8. Multi List (Struktur Data)
8. Multi List (Struktur Data)
Kelinci Coklat
 
Algoritma dan Struktur Data - Methods
Algoritma dan Struktur Data - MethodsAlgoritma dan Struktur Data - Methods
Algoritma dan Struktur Data - Methods
KuliahKita
 
Laporan Praktikum Web dengan PHP
Laporan Praktikum Web dengan PHPLaporan Praktikum Web dengan PHP
Laporan Praktikum Web dengan PHP
Okta Riveranda
 
Laporan hasil praktikum modul i pengenalan pascal
Laporan hasil praktikum modul i pengenalan pascalLaporan hasil praktikum modul i pengenalan pascal
Laporan hasil praktikum modul i pengenalan pascal
Meycelino A. T
 

Viewers also liked (16)

Seminar: PHP Developer for Dummies
Seminar: PHP Developer for DummiesSeminar: PHP Developer for Dummies
Seminar: PHP Developer for Dummies
Achmad Solichin
 
Presentasi fordis kkp skripsi genap 1314 (pra sidang)
Presentasi fordis kkp skripsi genap 1314 (pra sidang)Presentasi fordis kkp skripsi genap 1314 (pra sidang)
Presentasi fordis kkp skripsi genap 1314 (pra sidang)
Achmad Solichin
 
5 Tahun Membuat Pesawat Kertas
5 Tahun Membuat Pesawat Kertas5 Tahun Membuat Pesawat Kertas
5 Tahun Membuat Pesawat Kertas
Achmad Solichin
 
Pertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IFPertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IF
Achmad Solichin
 
Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?
Achmad Solichin
 
Pertemuan 5 - Struktur Kondisi IF (lanjutan)
Pertemuan 5 - Struktur Kondisi IF (lanjutan)Pertemuan 5 - Struktur Kondisi IF (lanjutan)
Pertemuan 5 - Struktur Kondisi IF (lanjutan)
Achmad Solichin
 
Quickstrat bootstrap
Quickstrat bootstrapQuickstrat bootstrap
Quickstrat bootstrap
Deni Ywn
 
Modern PHP Developer
Modern PHP DeveloperModern PHP Developer
Modern PHP Developer
Achmad Solichin
 
Chapter 01 - Introduction to Computers
Chapter 01 - Introduction to ComputersChapter 01 - Introduction to Computers
Chapter 01 - Introduction to Computers
Achmad Solichin
 
Makalah seminar nasional matematika 2012 pgri
Makalah seminar nasional matematika 2012 pgriMakalah seminar nasional matematika 2012 pgri
Makalah seminar nasional matematika 2012 pgri
arya0809
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
Achmad Solichin
 
Digital marketing — an overview
Digital marketing — an overviewDigital marketing — an overview
Digital marketing — an overview
Seth Familian
 
What's it like being a Woman in Tech?
What's it like being a Woman in Tech?What's it like being a Woman in Tech?
What's it like being a Woman in Tech?
Kiki Schirr
 
Working With Big Data
Working With Big DataWorking With Big Data
Working With Big Data
Seth Familian
 
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Cain Ransbottyn
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 
Seminar: PHP Developer for Dummies
Seminar: PHP Developer for DummiesSeminar: PHP Developer for Dummies
Seminar: PHP Developer for Dummies
Achmad Solichin
 
Presentasi fordis kkp skripsi genap 1314 (pra sidang)
Presentasi fordis kkp skripsi genap 1314 (pra sidang)Presentasi fordis kkp skripsi genap 1314 (pra sidang)
Presentasi fordis kkp skripsi genap 1314 (pra sidang)
Achmad Solichin
 
5 Tahun Membuat Pesawat Kertas
5 Tahun Membuat Pesawat Kertas5 Tahun Membuat Pesawat Kertas
5 Tahun Membuat Pesawat Kertas
Achmad Solichin
 
Pertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IFPertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IF
Achmad Solichin
 
Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?
Achmad Solichin
 
Pertemuan 5 - Struktur Kondisi IF (lanjutan)
Pertemuan 5 - Struktur Kondisi IF (lanjutan)Pertemuan 5 - Struktur Kondisi IF (lanjutan)
Pertemuan 5 - Struktur Kondisi IF (lanjutan)
Achmad Solichin
 
Quickstrat bootstrap
Quickstrat bootstrapQuickstrat bootstrap
Quickstrat bootstrap
Deni Ywn
 
Chapter 01 - Introduction to Computers
Chapter 01 - Introduction to ComputersChapter 01 - Introduction to Computers
Chapter 01 - Introduction to Computers
Achmad Solichin
 
Makalah seminar nasional matematika 2012 pgri
Makalah seminar nasional matematika 2012 pgriMakalah seminar nasional matematika 2012 pgri
Makalah seminar nasional matematika 2012 pgri
arya0809
 
Digital marketing — an overview
Digital marketing — an overviewDigital marketing — an overview
Digital marketing — an overview
Seth Familian
 
What's it like being a Woman in Tech?
What's it like being a Woman in Tech?What's it like being a Woman in Tech?
What's it like being a Woman in Tech?
Kiki Schirr
 
Working With Big Data
Working With Big DataWorking With Big Data
Working With Big Data
Seth Familian
 
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Privacy is an Illusion and you’re all losers! - Cryptocow - Infosecurity 2013
Cain Ransbottyn
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 
Ad

More from Achmad Solichin (20)

Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Achmad Solichin
 
Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)
Achmad Solichin
 
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Achmad Solichin
 
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Achmad Solichin
 
Webinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHPWebinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHP
Achmad Solichin
 
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi LuhurWebinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Achmad Solichin
 
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARUTREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Materi Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHPMateri Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHP
Achmad Solichin
 
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan RadiasiPercobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Depth First Search (DFS) pada Graph
Depth First Search (DFS) pada GraphDepth First Search (DFS) pada Graph
Depth First Search (DFS) pada Graph
Achmad Solichin
 
Breadth First Search (BFS) pada Graph
Breadth First Search (BFS) pada GraphBreadth First Search (BFS) pada Graph
Breadth First Search (BFS) pada Graph
Achmad Solichin
 
Binary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur DataBinary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur Data
Achmad Solichin
 
Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0
Achmad Solichin
 
Seminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web ProgrammerSeminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web Programmer
Achmad Solichin
 
The Big 5: Future IT Trends
The Big 5: Future IT TrendsThe Big 5: Future IT Trends
The Big 5: Future IT Trends
Achmad Solichin
 
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Achmad Solichin
 
Workshop PHP: Laporan HTML, Excel, PDF
Workshop PHP: Laporan HTML, Excel, PDFWorkshop PHP: Laporan HTML, Excel, PDF
Workshop PHP: Laporan HTML, Excel, PDF
Achmad Solichin
 
Pertemuan 07. File dan Direktori
Pertemuan 07. File dan DirektoriPertemuan 07. File dan Direktori
Pertemuan 07. File dan Direktori
Achmad Solichin
 
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Achmad Solichin
 
Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)
Achmad Solichin
 
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Achmad Solichin
 
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Achmad Solichin
 
Webinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHPWebinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHP
Achmad Solichin
 
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi LuhurWebinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Achmad Solichin
 
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARUTREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Materi Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHPMateri Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHP
Achmad Solichin
 
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan RadiasiPercobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Depth First Search (DFS) pada Graph
Depth First Search (DFS) pada GraphDepth First Search (DFS) pada Graph
Depth First Search (DFS) pada Graph
Achmad Solichin
 
Breadth First Search (BFS) pada Graph
Breadth First Search (BFS) pada GraphBreadth First Search (BFS) pada Graph
Breadth First Search (BFS) pada Graph
Achmad Solichin
 
Binary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur DataBinary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur Data
Achmad Solichin
 
Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0
Achmad Solichin
 
Seminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web ProgrammerSeminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web Programmer
Achmad Solichin
 
The Big 5: Future IT Trends
The Big 5: Future IT TrendsThe Big 5: Future IT Trends
The Big 5: Future IT Trends
Achmad Solichin
 
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Achmad Solichin
 
Workshop PHP: Laporan HTML, Excel, PDF
Workshop PHP: Laporan HTML, Excel, PDFWorkshop PHP: Laporan HTML, Excel, PDF
Workshop PHP: Laporan HTML, Excel, PDF
Achmad Solichin
 
Pertemuan 07. File dan Direktori
Pertemuan 07. File dan DirektoriPertemuan 07. File dan Direktori
Pertemuan 07. File dan Direktori
Achmad Solichin
 
Ad

Pertemuan 1 - Algoritma dan Struktur Data 1

  • 3. Pengertian array dua dimensi Array dua dimensi dapat dipandang sebagai gabungan array satu dimensi Pandanglah tiga buah array satu dimensi yang dibuat dengan int A1[5], int A2[5], int A3[5]. Ketiga buah array satu dimensi diatas, dapat digabung menjadi satu, sehingga terbentuk sebuah array yang disebut array dua dimensi yang biasanya diilustrasikan sebagai berikut :
  • 4. Array 1 Dimensi : char A[5] ; Array 2 Dimensi : char A[3][5] ; Isinya ada Tapi tidak diketahui Isinya ada Tapi tidak diketahui
  • 5. Array 1 Dimensi : char A[5] ; 0 1 2 3 4 Array 2 Dimensi : char A[3][5] ; 0 1 2 3 4 0 1 2 Jumlah kolom ( column ) Jumlah kolom Jumlah baris ( row ) Nomor Kolom ( index ) Nomor kolom Nomor baris
  • 6. Array 1 Dimensi : char A[5] ; 0 1 2 3 4 Array 2 Dimensi : char A[3][5] ; 0 1 2 3 4 0 1 2 Jumlah kolom Jumlah kolom Jumlah baris Nomor kolom Nomor kolom Nomor baris Isinya ada Tapi tidak diketahui Isinya ada Tapi tidak diketahui
  • 7. Array 2 Dimensi : char A[3][5] ; Sering disebut array 3 x 5
  • 8. Array 1 Dimensi : char A[5] = {‘A’,’B’,’C’,’D’,’E’} ; A B C D E 0 1 2 3 4 Array 2 Dimensi : char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’ , ‘K’,’L’,’M’,’N’,’O } ; A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2
  • 11. #include<stdio.h> void main() { char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[1][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 baris : 1 kolom : 2 Dev C++ 5.11 Contoh - 1
  • 12. #include<stdio.h> void main() { char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[1][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 H Dev C++ 5.11
  • 13. Array 2 Dimensi : 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 Dev C++ 5.11 H #include<stdio.h> void main() { char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[1][2] ); }
  • 14. #include<stdio.h> void main() { char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[1][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 DIULANG Apa yang tercetak ?
  • 15. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[1][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 H
  • 16. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[2][3] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 Apa yang tercetak ? Kalau ini : ?
  • 17. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[1][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 N
  • 18. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[3][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 Apa yang tercetak ? Kalau ini : ? 3 Apakah Error ?
  • 19. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; printf(" %c ", A[3][2] ); } 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 . Tercetak karakter sembarang sesuai dengan karakter apa yang ada pada lokasi tersebut saat itu TIDAK ERROR
  • 20. 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 char A[3][5]; A[0][0] A[0][2] A[1][3] ?
  • 21. 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 char A[3][5]; A[0][0] A[0][2] A[1][3] A[2][1]
  • 22. 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 char A[3][5]; A[0][0] A[0][2] A[1][3] A[2][1]
  • 24. 0 1 2 3 4 A B C D E F G H I J K L M N 0 0 1 2 char A[3][5]; i j 0 0 0 1 0 2 0 3 0 4 1 0 1 1 1 2 1 3 1 4 2 0 2 1 2 2 2 3 2 4 i j i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4
  • 25. Array 2 Dimensi : A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; Logical illustration 3 baris 5 kolom A B C D E 0,0 0,1 0,2 0,3 0,4 1,0 1,1 1,2 1,3 1,4 2,0 2,1 2,2 2,3 2,4 F G H I J K L M N 0 memory physical allocation secara fisik alamatnya contiguous 2,4 untuk menyatakan A[2][4]
  • 26. Array 2 Dimensi : A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 char A[3][5] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' } ; char A[3][5] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' } ; atau : atau :
  • 27. char A[3][5] = { ‘A’,’B’,’C’, ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’, } ; A B C 0 0 0 1 2 3 4 F G H I J K L 0 0 0 0 1 2 0 (NULL) 0 0 0 0 0 0 0 0 Karakter NULL semua bit-nya 0 (nol) Kalau dicetak dengan ; “ %c ” tercetak : spasi (blank “ %i “ tercetak : 0 (nol) “ %x “ tercetak : 00
  • 28. A 0 0 0 0 0 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0 1 2 char A[3][5] = { ‘A’ } ; char A[3][5] = { 65 } ; atau : atau :
  • 29. char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’ , ‘K’,’L’,’0’,’N’,’O’ } ; 0 1 2 3 4 A B C D E F G H I J K L 0 N 0 0 1 2 NULL
  • 30. char A[3][5] = { "ABCDE" , "FGHIJ" , "KL NO" } ; 0 1 2 3 4 A B C D E F G H I J K L N 0 0 1 2 space space
  • 32. 0 0 0 0 0 0 0 0 Karakter NULL Kalau dicetak dengan : “ %c ” tercetak : spasi (blank) “ %i “ tercetak : 0 (nol) “ %x“ tercetak : 00 0 0 1 0 0 0 0 0 Karakter space Kalau dicetak dengan ; “ %c ” tercetak : spasi (blank) “ %i “ tercetak : 32 “ %x “ tercetak : 20
  • 34. Contoh - 2 #include<stdio.h> main() { int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9,20,22,11 }; printf(" %c ", A[1][2] ); return 0; } 0 1 2 3 4 5 12 17 10 7 15 6 25 2 19 4 9 20 22 11 0 1 2 Dev C++ 5.11 Apa yang tercetak : ?
  • 35. Contoh - 2 #include<stdio.h> void main() { int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9,20,22,11 }; printf(" %c ", A[1][2] ); } 0 1 2 3 4 5 12 17 10 7 15 6 25 2 19 4 9 20 22 11 0 1 2 Dev C++ 5.11 25
  • 36. int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9,20,22,11 }; int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9,20,22,11 }; int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9,20, 22,11 }; int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 0 1 2 3 4 5 12 17 10 7 15 6 25 2 19 4 9 20 22 11 0 1 2 atau : atau : atau : int A[3][5] = { 5,12,17,10,7, 15,6,25, 2,19,4,9, 20, 22,11 }; atau :
  • 37. int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9, } ; 0 1 2 3 4 5 12 17 10 7 15 6 25 2 19 4 9 0 0 0 0 1 2 Lokasi yang tidak diisi, otomatis diisi dengan 0 (nol) Hanya diisi 12 elemen 3 elemen terakhir tidak diisi
  • 38. int A[3][5] = { 5,12,17,10,7, 15,6,25,2,19, 4,9, } ; 0 1 2 3 4 5 12 17 10 7 15 6 25 2 19 4 9 0 0 0 0 1 2 int A[3][5] = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,15,16 } ; ERROR maksimu m 15 elemen
  • 40. Dev C++ 5.11 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; j=2; { printf( "%c ", A[0] [ j ] ); } } Apa yang tercetak : ? Contoh – 3a
  • 41. Borland Turbo-C++ A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; j=2; { printf( "%c ", A[0] [ j ] ); } } Apa yang tercetak : ? Contoh – 3a
  • 42. Borland Turbo-C++ A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; j=2; { printf( "%c ", A[0] [ j ] ); } } Contoh – 3a C
  • 44. Dev C++ 5.11 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; for( j=0; j<=4; j++ ) { printf( "%c ", A[0] [ j ] ); } } Apa yang tercetak : ? Contoh – 4
  • 45. Dev C++ 5.11 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; for( j=0; j<=4; j++ ) { printf( "%c ", A[0] [ j ] ); } }Apa yang tercetak : ? Contoh – 4 j elemen yang isinya dicetak 0 1 2 3 4 A[0][0] A[0][1] A[0][2] A[0][3] A[0][4]
  • 46. Dev C++ 5.11 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; for( j=0; j<=4; j++ ) { printf( "%c ", A[0] [ j ] ); } } Contoh – 4 j elemen yang isinya dicetak 0 1 2 3 4 A[0][0] A[0][1] A[0][2] A[0][3] A[0][4] A B C D E
  • 47. Dev C++ 5.11 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int j; for( …………………… ) { …………………………… ); } }A B C D E Contoh – 4 Tulis ulang ! supaya tercetak : A B C D E
  • 50. #include<stdio.h> void main( ) {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i; for( i=0; i<=2; i++ ) { printf( "%c ", A[i][0]); } } Dev C++ 5.11 Contoh - 5 Apa yang tercetak : ?
  • 51. A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main( ) {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i; for( i=0; i<=2; i++ ) { printf( "%c ", A[i][0]); } } Dev C++ 5.11 Contoh - 5 Apa yang tercetak : ?
  • 52. A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main( ) {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i; for( i=0; i<=2; i++ ) { printf( "%c ", A[i][0]); } } Dev C++ 5.11 Contoh - 5 i elemen yang isinya dicetak 0 1 2 A[0][0] A[1][0] A[2][0] Apa yang tercetak : ?
  • 53. A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main( ) {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i; for( i=0; i<=2; i++ ) { printf( "%c ", A[i][0]); } } A F K Borland Turbo-C++ Contoh - 5 i elemen yang isinya dicetak 0 1 2 A[0][0] A[1][0] A[2][0]
  • 54. A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 #include<stdio.h> void main( ) char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i; for( ……………………) { ……………………………..); } } Borland Turbo-C++ Contoh - 5 i elemen yang isinya dicetak 0 1 2 A[0][0] A[1][0] A[2][0]Tulis ulang ! supaya tercetak : A F K
  • 57. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Dev C++ 5.11Contoh - 6 Apa yang tercetak : ? Tulis ! Apa yang tercetak
  • 58. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Dev C++ 5.11Contoh - 6 Apa yang tercetak : ? i j 0 1 2 3 4 1 1 2 3 4 2 1 2 3 4
  • 59. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Dev C++ 5.11Contoh - 6 Apa yang tercetak : ? i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 urutan proses
  • 60. #include<stdio.h> void main() { char A[3][5]={ "ABCDE" , "FGHIJ" , "KLMNO" }; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Borland Turbo-C++Contoh - 6 Apa yang tercetak : ? i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i
  • 61. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Borland Turbo-C++Contoh - 6 Apa yang tercetak : ? i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i Tercetak : A B C D E
  • 62. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Borland Turbo-C++Contoh - 6 Apa yang tercetak : ? i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i Tercetak : F G H I J
  • 63. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Borland Turbo-C++Contoh - 6 Apa yang tercetak : ? i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i Tercetak : K L M N O
  • 64. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Borland Turbo-C++Contoh - 6 Apa yang tercetak : ? i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i Tercetak : A B C D E F G H I J K L M N O
  • 65. #include<stdio.h> void main() char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for( i=0; i<=2; i++ ) { for( j=0; j<=4; j++) { printf("%c ", A[i][j]); } printf("n"); } } Borland Turbo-C++Contoh - 6 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i A B C D E F G H I J K L M N O i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4
  • 66. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(………………… ) { for( …………………….) {…………………………); } printf("n"); } } Borland Turbo-C++Contoh - 6 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i i j 0 0 1 2 3 4 1 0 1 2 3 4 2 0 1 2 3 4 Tulis ulang, untuk mencetak : ABC D E FGH I J KLMNO
  • 68. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } Apa yang tercetak : ? Tulis ! Apa yang tercetak
  • 69. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } }Apa yang tercetak : ? A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j
  • 70. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2
  • 71. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 urutan proses
  • 72. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j Tercetak : A F K
  • 73. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j Tercetak : B G L
  • 74. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j Tercetak : C H M
  • 75. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j Tercetak : D I N
  • 76. #include<stdio.h> void main() {char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j Tercetak : E J O
  • 77. #include<stdio.h> void main() char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j AF K BGL CHM D I N EJ O Tercetak : A F K B G L C H M D I N E J O
  • 78. #include<stdio.h> void main() char A[3][5] = { ‘A’,’B’,’C’,’D’,’E’ , ‘F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’ } ; int i, j; for(j=0; j<=4; j++ ) { for( i=0; i<=2; i++) { printf("%c",A[ i][ j ]); } printf("n"); } } j i 0 0 1 2 1 0 1 2 2 0 1 2 3 0 1 2 4 0 1 2 A B C D E 0 1 2 3 4 F G H I J K L M N 0 0 1 2 i j [ 0 ] [ 0 ] [ 1 ] [ 0 ] [ 2 ] [ 0 ] [ 0 ] [ 1 ] [ 1 ] [ 1 ] [ 2 ] [ 1 ] [ 0 ] [ 2 ] [ 1 ] [ 2 ] [ 2 ] [ 2 ] [ 0 ] [ 3 ] [ 1 ] [ 3 ] [ 2 ] [ 3 ] [ 0 ] [ 4 ] [ 1 ] [ 4 ] [ 2 ] [ 4 ] [ 0 ] [ 0 ] [ 1 ] [ 0 ] [ 2 ] [ 0 ] [ 0 ] [ 1 ] [ 1 ] [ 1 ] [ 2 ] [ 1 ] ---- ---- [ 2 ] [ 4 ] A F K BG L CHM D I N EJ O
  翻译: