Posted by Belajar Pemrograman
Program Array Satu Dimensi di Bahasa C
#include<stdio.h>
main()
{
int f[5];
int a;
int b;
for(a=0;a<=4;a++)
scanf("%i",&f[a]);
printf("\n");
printf("Hasilnya \n");
printf("-------- \n");
for(a=0;a<=4;a++)
printf("Index ke-[%i] = %i\n",a,f[a]);
printf("\n");
printf("Pilih index ke- ");
scanf("%d",&b);
printf("Hasil ");
printf("%d",f[b]);
printf("\n");
system("pause");
}