array multi dimensi

Posted: November 21, 2010 in Bahasa C

by. Ridwan Aceh

output yang dihasilkan

 

 

 

 

 

 

 

 

/*Praktek bahasa c      */
/*@2010 */
#include <stdio.h>
#include <conio.h>
void main()
{ int i, j, k;
static int data_huruf[3][8][8] =
{ { { 1, 1, 1, 1, 1, 1, 1, 0 },
{ 1, 1, 0, 0, 0, 0, 1, 0 },
{ 1, 1, 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 0 },
{ 1, 0, 0, 0, 1, 1, 1, 0 },
{ 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 }
},
{ { 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 }
},
{ { 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 }
}

};

/* menampilkan Huruf */
for(i=0; i<3; i++)
{ for(j=0; j<8; j++)
{ for(k=0;k<8; k++)
if(data_huruf[i][j][k])
putchar(‘\xDB’);
else
printf(” “);
puts(” “);
}
puts(” “);
}
getch();
}

 

Komentar
  1. Made Darwan mengatakan:

    Salam Kenal…………..
    bisa minta contoh Programnya?

  2. elyne mengatakan:

    klo hasil outputnya kayak gini
    0 0 0 0 1 0 0 2 0 0
    0 1 0 0 0 0 0 0 0 0
    1 0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0 0
    0 0 0 4 0 0 0 0 0 0
    0 0 0 0 0 0 0 2 0 0
    0 0 0 0 0 0 0 0 0 0
    2 1 0 0 0 0 0 0 0 0
    dipraktekin ke c++ nya gimana ya??? mohon sharing nya ya???!!
    mks

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s