Array




 Kumpulan variabel memiliki tipe data yang sama
– Variabel bisa simpel (char, float, double, int) atau tipe data kompleks(struct, pointer, class)
– Setiap elemen array ditandai dengan nama array dan diikuti dengantanda kurung siku buka dan tutup dimana didalamnya terdapatjumlah elemen array
– Elemen array harus dinyatakan sebagai non negatif integer
Contoh Program :
#include<iostream.h>
#include<conio.h>
main()
{
int a[5]={10,15,20,25,30};
int b[5]={10,20};
int c[5]={15,0,30};
int j;

// Menampilkan nilai dari element array
cout<<endl;
for(j=0;j<5;j++)
{
cout<<"A ["<<j<<"] = "<<a[j]<<" , B ["<<j<<"] = "<<b[j]<<" , C ["<<j<<"] = "<<c[j]<<endl;
}
getch();
}
Outputnya: 

                             



One Response to Array

  1. Okay...

    This may sound pretty weird, and maybe even kind of "strange"

    WHAT if you could simply push "PLAY" and listen to a short, "musical tone"...

    And miraculously bring MORE MONEY to your LIFE???

    And I'm talking about BIG MONEY, even MILLIONS of DOLLARS!

    Think it's too EASY??? Think it's IMPOSSIBLE?

    Well then, I'll be the one to tell you the news...

    Sometimes the largest blessings life has to offer are also the EASIEST!

    In fact, I will provide you with PROOF by letting you listen to a REAL "miracle abundance tone" I've produced...

    YOU simply push "PLAY" and the money will start coming into your life... starting pretty much right away...

    GO here to PLAY this wonderful "Miracle Abundance Sound Frequency" - as my gift to you!

    BalasHapus