You are on page 1of 2

LARIK (ARRAY)

1.
#include <stdio.h>
#include <conio.h>
void main()
{
int i, j, k;
int data_huruf[2][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, 0, 1, 1, 1, 1, 0 },
{ 1, 1, 0, 0, 1, 1, 1, 0 },
{ 1, 1, 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, 0, 0 },
{ 1, 1, 0, 0, 0, 1, 1, 0 },
{ 1, 1, 0, 0, 0, 1, 1, 0 },
{ 1, 1, 1, 1, 1, 1, 0, 0 },
{ 1, 1, 0, 0, 0, 1, 1, 0 },
{ 1, 1, 0, 0, 0, 1, 1, 0 },
{ 1, 1, 0, 0, 0, 1, 1, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 }
}
};
/* Tampilkan Huruf */
for(i=0; i<2; i++)
{ for(j=0; j<8; j++)

{ for(k=0;k<8; k++)
if(data_huruf[i][j][k])
printf("\xDB");
else
printf(" "); /* spasi */
puts("");
}
puts("");
}
getch();
}
2.
#include <stdio.h>
#include <conio.h>
void main()
{ int nilai[7], x;
printf("-----------------\n");
printf("Memasukkan 7 Data :\n");
for(x=0;x<7;x++)
{
printf("Data Angka : "); scanf("%d",&nilai[x]);
}
printf("\n");
printf("----------------\n");
printf("Data

|\n");

printf("----------------\n");
for(x=0;x<7;x++)
{
printf("Nilai Data : %d\n",nilai[x]);
}
getch();
}

You might also like