array 2 dimensi

On Rabu, 08 Juni 2011 0 komentar

contoh program lainya? ini membentuk huruf A lho!!!!! baru tau?????

#include <stdio.h>
main()
{
int i,j;
static int huruf_A[8][8]={{ 0,1,1,1,1,1,0,0 },
              { 0,1,0,0,0,1,0,0 },
              { 0,1,0,0,0,1,0,0 },
              { 1,1,1,1,1,1,1,0 },
              { 1,1,0,0,0,0,1,0 },
              { 1,1,0,0,0,0,1,0 },
              { 1,1,0,0,0,0,1,0 },
              { 0,0,0,0,0,0,0,0 }};
clrscr();
for ( i=0; i<8; i++)
  {
  for ( j=0; j<8; j++)
if ( huruf_A[i][j])
   putchar ('\xDB');

   else
     putchar (' '); /* spasi */
     puts (" " );
   }
getch();
}







hasilnya seperti dibawah ini:

0 komentar: