728x90

Breaking News Bray

Mengenal Sistem Array Di Dev C + +



WuanjrotBray,-

Apa sih array itu sebenarnya dan buat apa kita mempelajari array ? Ternyata array banyak manfaatnya, karena dengan array kita bisa menyimpan data dari struktur penyimpanan di suatu tempat.

Index array dimulai dari angka 0 dan ukuran besarnya tergantung data yang disimpan.

// membuat array kosong dengan tipe data integer dan panjang 10
int nama_array[10];

// membuat array dengan langsung diisi
int nama_arr[3] = {0, 3, 2}


Cara Mengambil Huruf dari array 

Jika kita mau mengambil huruf dari array misalkan huruf  B

char huruf[5] = {'a', 'b', 'c', 'd', 'e'};

Dari array di atas cara mengambil huruf B dengan cara

huruf[1];

kenapa gak pake angka 2 ?

Jangan Lupa Index array dimulai dari 0

#include <iostream>
using namespace std;

int main(){
    char huruf[5] = {'a', 'b', 'c', 'd', 'e'};

    // mengambil data pada array
    cout << "Huruf: " << huruf[2] << endl;

    return 0;
}

Dari kasus di atas maka setelah di compile pilihan akan jatuh ke pilihan huruf C


Tugas 
Seilakan membuat contoh tentang pilihan menggunakan array dan masukan ke komentar !

72 comments:

  1. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }


    Nabila citra
    X Tkj e

    ReplyDelete
  2. #include
    #include

    Int main(void)
    {
    Int farian[5]={'60', '50', '27', '22', '18'};
    Int i;
    Int total=0;

    For {I=e; i<5; i++)
    {
    Total ++ ferian[i];
    }
    Print ("Total umur adalah %d", total);

    Getch();
    Return e;
    }


    Nama:Rizki Adi
    Kelas:x TKJ c

    ReplyDelete
  3. #include
    using namespace std;

    int x,y;
    int tabel[3][5] = {
    {1, 2, 3, 4, 5},
    {2, 4, 6, 8, 10},
    {3, 6, 9, 12, 15}
    };

    int main ()
    {
    for (x=0; x<3; x++)
    for (y=0; y<5; y++)
    {
    cout << tabel[x][y] << " ";
    }
    cout << "\n";
    }


    Nama: Sabrina febriani
    X.TKJ.C

    ReplyDelete
  4. #include
    using namespace std;

    int main()
    {
    int nilai[4]={3,5,7,8};
    cout<<nilai[0]<<endl;
    cout<<nilai[1]<<endl;
    cout<<nilai[2]<<endl;
    cout<<nilai[3]<<endl;
    }

    Nama : Luvi Shevila Herawati
    Kelas : X TKJ D

    ReplyDelete
  5. #include
    using namespace std;

    int main ()
    {
    int matriks[2][4]={{1,2,3,4},{5,6,7,8}};
    int baris,kolom;
    for (baris=0;baris<2;baris++)
    {
    for (kolom=0;kolom<4;kolom++)
    {
    cout<<matriks[baris][kolom]<<" ";
    }
    cout<<endl;
    }
    }


    Nama: Eva Rosliani
    Kelas : X TKJ D

    ReplyDelete
  6. #include
    using namespace std;

    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;

    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    Nama:salsa febiyanti
    Kelas:X TKJ E

    ReplyDelete
  7. #include
    using namespace std;

    int x,y;
    int tabel[3][5] = {
    {1, 2, 3, 4, 5},
    {2, 4, 6, 8, 10},
    {3, 6, 9, 12, 15}
    };

    int main ()
    {
    for (x=0; x<3; x++)
    for (y=0; y<5; y++)
    {
    cout << tabel[x][y] << " ";
    }
    cout << "\n";
    }

    Yuli. Wahyuni
    X Tkj E

    ReplyDelete
  8. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }


    Nama: Delia
    Kelas: X TKJ E

    ReplyDelete
  9. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }


    Nama: Delia
    Kelas: X TKJ E

    ReplyDelete
  10. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }


    Nama:Selvia Meliani
    Kelas: X TKJ D

    ReplyDelete
  11. #include//header
    #include
    Using namespace std;

    Int main()
    {
    //Mendeklarasikan nilai-nilai kedalam variabel A
    Int A[5] = {1,2,3,4,5};
    //Menampilkannya nilai yang terdapat pada elemen-elemen arry
    For(int i=0;i<5;i++)
    {
    cout<<"Nilai data pada elemen ke-"<<i;
    cout<<"="<<A[i]<<endl;
    }
    getch();
    }



    Ayu Dwi Septiani
    X TKJ B

    ReplyDelete
  12. #include
    Using namespace std;

    Int umur[] = {18,19,20,21,22};
    Int n, hasil=0;

    Int main ()
    {
    For(n=0; n<5; ++n)
    {
    Hasil+= umur [n];
    }
    Cout<<hasil;
    Return0;
    }


    M Rizal Ramadhan
    X TKJ B

    ReplyDelete
  13. #include
    Using namespace std;

    Int main(){
    Char angka[3]={'1','2','3','4','5','6'};
    //Mengambil data
    Cout<<"angka:"<<[3]<<endl;
    Return0
    }


    M Rizal Ramadhan
    X TKJ B

    ReplyDelete
  14. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    Nama : Fikri Muhammad Isya
    Kelas: X Tkj E

    ReplyDelete
  15. #include
    Using namespace std;

    Int main()
    {
    Int nilai [2]={4,6,8,12};
    Cout <<nilai[0]<< endl;
    Cout <<nilai[1]<< endl;
    Cout <<nilai[2]<< endl;
    Cout <<nilai[3]<< endl;

    }

    Nama:Reysyah Fabian
    Kelas:X TKJ D

    ReplyDelete
    Replies
    1. #include
      Using namespace std;

      Int main()
      {
      Int nilai [5]={2,4,5,7,6};
      Cout <<nilai[0]<< endl;
      Cout <<nilai[1]<< endl;
      Cout <<nilai[2]<< endl;
      Cout <<nilai[3]<< endl;

      }

      Nama:Reysyah Fabian
      Kelas:X TKJ D

      Delete
  16. #include
    using namespace std;

    int main(){
    char angka[4] = {'10','11','12','13'};
    // menggambil data pada arry
    cout << "Huruf: " << huruf[2];

    return 0;
    }



    Nama=Sri puspita sari
    Kls=x tkj d

    ReplyDelete
  17. #include
    Using namespace std;

    Int main()
    {
    Int nilai[5]={1,2,3,4,5}
    cout<<nilai[0]<<endl;
    return 0;
    }


    Hasilnya=1

    Nama:Shafa salsabila
    Kelas:X TKJ D

    ReplyDelete
  18. #include
    using namespace std;
    int main
    int tampungan[6]={4,3,7,8,9,1};
    for(int i=0; 1<=5; i++){
    cout<<"nilai pada array tampungan elemen ke "<<i<<" adalah:"<<tampungan [i]<<endl;
    }
    return 0;
    }

    ReplyDelete
  19. #include
    using namespace std;

    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;

    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    Nama: Sintia Aprilia
    Kelas: X TKJ E

    ReplyDelete
  20. #include
    Using namespace std;

    Int main(){
    Int arraymulti[2][3] ={{1,2,3},{4,5,6}};
    Cont<<"Jamil gans Moal gagal dijamin bohong"<<endl;
    For(int x=0 x<=1; x++){
    For(int y=0 y<=2; y++){
    Cont<<"jamil gans gans ganteng["<<x<<"]["<<y<<"] adalah"<<arraymulti[x][y]<<endl;
    }
    }
    Rerturn 0;
    }


    Nama:M.Jamil.A
    Kelas:X TKJ d

    ReplyDelete
  21. include
    using namespace std;

    int main()
    {
    int nilai[4]={3,5,7,8};
    cout<<nilai[0]<<endl;
    cout<<nilai[1]<<endl;
    cout<<nilai[2]<<endl;
    cout<<nilai[3]<<endl;
    }

    X tkj d

    ReplyDelete
  22. #include
    Using namespace std;
    Int tanggal[] ={1,2,3,4,5};
    Int u, hasil=0;
    Int main()
    {
    For (u=0;u<4;++u)
    {
    Hasil+=tanggal[u] ;
    }
    Cout <<hasil;
    Return 0;
    }
    Nama:chandra
    Kelas:x tkj d

    ReplyDelete
  23. #include
    Using namespace std;

    Int main(){
    Char nama[13] = "Rafli";
    For (int i=0; nama [i]!='\0';I++){
    Cout<<nama[i];
    }
    Cout<<endl;
    Return 0;
    }

    ReplyDelete
  24. #include
    using namespace std;
    int angka[]={1,2,3,4,5,6,7,8,9,10};
    int n, hasil=0;
    int main()
    {
    for(n=0;n<4;++n)
    {
    hasil+=angka[n];
    }
    cout<<"hasil";
    Return 0;
    }


    Nama :syarif hidayatulloh
    Kelas:X TKJ D

    ReplyDelete
  25. #include
    Using name space std;
    Int angka[]={2,4,6,8,};
    Int n, hasil=0;
    Int main()
    {
    For(n=0;n<4;++n)
    {
    Hasil+=angka[n];
    }
    cout<<"hasil";
    return 0;
    }



    M. Fakhri
    X Tkj D

    ReplyDelete
  26. #include
    using namespace std;
    int angka[]={5,6,7,8};
    int n, hasil=0;
    int main()
    {
    for(n=0;n<4;++n)
    {
    hasil+=angka[n];
    }
    cout<<"hasil";
    Return 0;
    }


    Nama:Mulya Taupik Putra
    Kelas: X Tkj D

    ReplyDelete
  27. #include
    Using namespace std;
    Int tanggal[] ={1,2,3,4,5};
    Int u, hasil=0;
    Int main()
    {
    For (u=0;u<4;++u)
    {
    Hasil+=tanggal[u] ;
    }
    Cout <<hasil;
    Return 0;
    }

    Nama: M Fikri Ilham
    Kelas: X TKJ D

    ReplyDelete
  28. #include
    Using name space std;
    Int angka[]={2,4,6,8,10};
    Int n, hasil=0;
    Int main()
    {
    For(n=0;n<4;++n)
    {
    Hasil+=angka[n];
    }
    cout<<"hasil";
    return 0;
    }





    M Ridzki Al Firdaus
    X TKJ D

    ReplyDelete
  29. #include
    using namespace std;

    int main (){
    int x [5];
    cout<<"Masukkan nilai 1 :";
    cin>>x[0];
    cout<<"Masukkan nilai 2 :";
    cin>>x[1];
    cout<<"Masukkan nilai 3 :";
    cin>>x[2];
    cout<<"Masukkan nilai 4 :";
    cin>>x[3];
    cout<<"Masukkan nilai 5 :";
    cin>>x[4];
    return 0 ;
    }

    Nama :Dhava Raditya
    Kelas : X TKJ D

    ReplyDelete
  30. #inlcude
    using namespace std;
    int angka[ ]={1,2,3,4,5,6,7,8,}
    int main()
    {
    For(n=0;n<4;++n)
    {
    hasil+=angka[n];
    }
    cout<<"Hasil";
    return 0;
    }


    Nama:Sandri Arya
    Kelas:X TKJ D

    ReplyDelete
  31. #inlcude
    using namespace std;
    int angka[ ]={1,2,3,4,5,6,7,8,}
    int main()
    {
    For(n=0;n<4;++n)
    {
    hasil+=angka[n];
    }
    cout<<"Hasil";
    return 0;
    }


    Nama:Sandri Arya
    Kelas:X TKJ D

    ReplyDelete
  32. #include
    using namespace std;

    int main(){

    string nama_guru[] = {"Pa Ridwan", "Pa Alip", "Pa Adi", "Pa Mus", "Pa ZamZam"};

    cout << "Guru : " << nama_guru[2] << endl;

    return 0;
    }

    Outputnya = Pa Adi


    Restu Ramadhan s
    X TKJ D

    ReplyDelete
  33. Include
    using namespace std;

    string merk_monitor[ ] ={Samsung,Toshiba,Polytron,LG,Polysonic};
    Int main(){
    cout<<"merk monitor:"<<merk_monitor[3]<<endl;

    return 0;
    }

    Hasil/outputnya =LG

    RIZKIA PERMANA
    X TKJ D

    ReplyDelete
  34. #include
    using namespace std;

    int main(){
    char angka[5] = {'1','2','3','4','5'};

    //Mengambil data pada array
    Cout<<"Angka: " << angka[3]<<endl;

    return 0;
    }



    Nama:Nurul Latifah
    Kelas: X TKJ D


    ReplyDelete
  35. #include
    using namespace std;
    int main(void)
    {
    int bilangan[2][2];

    bilangan[0][0] = 100;
    bilangan[0][1] = 101;
    bilangan[1][0] = 110;
    bilangan[1][1] = 111;

    cout<<("isi array bilangan:n");
    cout<<("n" ,bilangan[0][0],bilangan[0][1]);
    cout<<("n" ,bilangan[1][0],bilangan[1][1]);

    return 0;
    }

    Nama :Intan komala sari
    Kelas:X tkj-e

    ReplyDelete
  36. #include
    using namespace std;
    int umur[]= {10,16,17,18,19};
    int n,hasi=0;
    int main()
    {
    for ( n=0 ; n<5 ; ++n)
    {
    hasil+=umur[n];
    }
    cout<<hasil;
    return 0;
    }

    Nama:Dian Septiana
    Kelas:X TKJ D

    ReplyDelete
  37. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    Nama:Nisvi Syabani
    Kelas: X TKJ E

    ReplyDelete
  38. #include
    Ll namespace std;

    int x,y;
    int tabel[3][5] = {
    {1, 2, 3, 4, 5},
    {2, 4, 6, 8, 10},
    {3, 6, 9, 12, 15}
    };

    int main ()
    {
    for (x=0; x<3; x++)
    for (y=0; y<5; y++)
    {
    cout << tabel[x][y] << " ";
    }
    cout << "\n";
    }

    ReplyDelete
  39. #include
    Using namespace std;

    int x,y;
    int tabel[3][5] = {
    {1, 2, 3, 4, 5},
    {2, 4, 6, 8, 10},
    {3, 6, 9, 12, 15}
    };

    int main ()
    {
    for (x=0; x<3; x++)
    for (y=0; y<5; y++)
    {
    cout << tabel[x][y] << " ";
    }
    cout << "\n";
    }

    Vioni ramadani
    X tkj e

    ReplyDelete
  40. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    nama : tian sanjaya junaedi
    kelas : x - tkj - b

    ReplyDelete
  41. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }


    fitri handayani
    X Tkj e

    ReplyDelete
  42. #include
    using namespace std;

    int main( )
    {
    int matriks [2][4] = {{1,2,3,4},{5,6,7,8}};
    int baris, kolom;
    for (baris=0;baris<2;baris++)
    {
    for (kolom=0;kolom<4;kolom++)
    {
    cout<<matriks[baris][kolom]<<" ";
    }
    cout<<endl;
    }
    }



    Nama : Fida Yunia Rahmawati
    Kelas : X TKJ- e

    ReplyDelete
  43. #include
    using namespace std;

    int main(){

    char angka[5] = {'1','2','3','4','5'};

    //Mengambil data pada array
    Cout<<"Angka: " << angka[3]<<endl;

    return 0;
    }

    Nama : Ainnun sobariah
    Kelas:X tkje

    ReplyDelete
  44. #include
    using namespace std;

    int main()
    {
    int nilai[4]={3,5,7,8};
    cout<<nilai[0]<<endl;
    cout<<nilai[1]<<endl;
    cout<<nilai[2]<<endl;
    cout<<nilai[3]<<endl;
    }

    Nama : Sabila Natasya Septiani
    Kelas: x TKJ-E

    ReplyDelete
  45. #include // header
    #include
    using namespace std;

    int main()

    {

    // Mendeklarasikan nilai-nilai ke dalam variabel A

    int A[5] = {1, 2, 3, 4, 5};

    // Menampilkannya nilai yang terdapat pada elemen-elemen array

    for (int i=0; i<5; i++)

    {

    cout<<“Nilai data pada elemen ke-“<<i ;

    cout<<” = ” <<A[i]<<endl;

    }
    getch();
    }




    X TKJ E

    ReplyDelete
  46. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }


    Nama:dhea fazrin
    Kelas: X tkj e

    ReplyDelete
  47. include
    using namespace std;
    int umur[]={18,19,20,21,22};
    int n,hasil=0;
    int main()
    {
    for ( n=0;n<5;++n)
    {
    hasil+=umur[n];
    }
    cout<<hasil;
    return 0;
    }

    ReplyDelete
  48. #include
    using namespace std;
    int umur[] = {14, 15, 16, 17, 18};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    teguh agustian p
    x tkj e

    ReplyDelete
  49. #include
    using namespace std;

    int main(){
    char angka[5] = {'1','2','3','4','5'};

    //Mengambil data pada array
    Cout<<"Angka: " << angka[3]<<endl;

    return 0;
    }

    Nama : ainun sobariah
    Kelas: x tkje

    ReplyDelete
  50. #include
    using namespace std;

    int main()
    {
    int nilai[5]={3,5,7,8};
    cout<<nilai[0]<<endl;
    cout<<nilai[1]<<endl;
    cout<<nilai[2]<<endl;
    cout<<nilai[3]<<endl;
    }
    Nama:m.fikri.f
    Kelas:X Tkj e

    ReplyDelete
  51. #include
    using namespace std;

    int main(){
    char angka[5] = {'1','2','3','4','5'};

    //Mengambil data pada array
    Cout<<"Angka: " << angka[3]<<endl;

    return 0;
    }

    Nama : Risman
    Kelas: X tkj e

    ReplyDelete
  52. #include
    using namespace std;
    int angka[]={1,2,3,4,5,6,7,8,9,10};
    int n, hasil=0;
    int main()
    {
    for(n=0;n<4;++n)
    {
    hasil+=angka[n];
    }
    cout<<"hasil";
    Return 0;
    }



    Nama:Lia
    X TKJ E

    ReplyDelete
  53. #include
    using namespace std;

    int main(){
    int nilai[5]={2,4,5,6,8,10};
    cout<<nilai[0]<<endl;
    cout<<nilai[2]<<endl;
    cout<<nilai[4]<<endl;
    }



    Nama: Dicki Maulana
    Kelas:X TKJ E

    ReplyDelete
  54. #include
    using namespace std;
    int umur[] = {5,9,10,15,18};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    Farhan abdul ikhsan
    X-TKJ-E

    ReplyDelete
  55. #include //For 'cout'

    using namespace std;

    int main()
    {
    int ClassScores[] = { 15, 30, 55, 62, 45 }; //Declare and initialize our 'ClassScores' array

    cout << "1: "<< ClassScores[0] << endl;
    cout << "2: "<< ClassScores[1] << endl;
    cout << "3: "<< ClassScores[2] << endl;
    cout << "4: "<< ClassScores[3] << endl;
    cout << "5: "<< ClassScores[4] << endl;

    return 0;
    Nama;Rafly kusuma w
    Kelas;x tkj e

    ReplyDelete
  56. #include
    Using namespace std;

    Int main()
    {
    int nilai[5]={2,5,7,8,10};
    cout<<nilai [0]<<endl;
    cout<<nilai [2]<<endl;
    cout<<nilai [3]<<endl;
    }


    Nama:Ganny.Ferdiansyah
    Kelas:X TKJ E

    ReplyDelete
  57. #include
    using namespace std;

    int main(){
    char huruf[5]={'a','f','i','r','s'};
    cout<<"huruf :"<<huruf[3]<<endl;
    cout<<"huruf :"<<huruf[0]<<endl;
    cout<<"huruf :"<<huruf[1]<<endl;
    cout<<"huruf :"<<huruf[2]<<endl;
    cout<<"huruf :"<<huruf[4]<<endl;
    cout<<"huruf :"<<huruf[3]<<endl;
    return 0;
    }

    Nama : Rafi Syahrul Ramadhan
    Kelas : X TKJ E

    ReplyDelete
  58. #include
    using namespace std;

    int main(){
    int nilai[5]={2,4,5,6,8,10};
    cout<<nilai[2]<<endl;
    cout<<nilai[3]<<endl;
    cout<<nilai[4]<<endl;
    }


    Dicky Galuh A
    X-TKJ-E

    ReplyDelete
  59. #include//header
    #include
    Using namespace std;

    Int main()
    {
    //Mendeklarasikan nilai-nilai kedalam variabel A
    Int A[5] = {1,2,3,4,5};
    //Menampilkannya nilai yang terdapat pada elemen-elemen arry
    For(int i=0;i<5;i++)
    {
    cout<<"Nilai data pada elemen ke-"<<i;
    cout<<"="<<A[i]<<endl;
    }
    getch();
    }


    Yosep G
    X TKJ E

    ReplyDelete
  60. #include
    using namespace std;

    int main(){
    char angka[5] = {'1','2','3','4','5'};

    //Mengambil data pada array
    Cout<<"Angka: " << angka[3]<<endl;

    return 0;
    }

    Nama:putri salwa ramadhani
    Kelas:X TKJ D

    ReplyDelete
  61. #include
    using namespace std;

    int main()
    {
    char nama[100][100];
    int nilai[100];
    int no;

    cout<<"masukkan jumlah mahasiswa: ";
    cin>>no;

    //input data
    for (int i=1;i<=no;i++){
    cout<<"masukkan nama mahasiswa: ";
    cin>>nama[i];
    cout<<"masukkan nilai mahasiswa: ";
    cin>>nilai[i];
    }

    //menampilkan data
    cout<<"tampilkan data"<<endl;
    for (int a=1;a<=no;a++){
    cout<<"nama: "<<nama[a]<<" dengan nilai: "<<nilai[a]<<endl;
    cout<<"by fian panic"<<endl;
    }
    return 0;
    }

    ReplyDelete
  62. #include
    using namespace std;
    int umur[] = {18, 19, 20, 21, 22};
    int n, hasil=0;
    int main ()
    {
    for ( n=0 ; n<5 ; ++n )
    {
    hasil+= umur[n];
    }
    cout << hasil;
    return 0;
    }

    Dimas Ristyan
    X TKJ C

    ReplyDelete
  63. #include
    using namespace std;

    int main (){
    int x[5],i;
    for(i=0;i<=4;i++)
    {

    cout<<"Masukkan
    nilai "<>x[i];
    }
    cout<<endl;
    for(i=0;i<=4;i++)
    {
    cout<<"Nilai ke-"<<i+1<<" = "<<x[i]<<endl;
    }
    cout<<endl;
    return 0;
    }

    Yesa Arta Mervia
    X-TKJ B

    ReplyDelete
  64. #include
    using namespace std;
    int main()
    {
    int data[5]={2,4,8,16,32};
    int wanda;
    for(wanda=0;wanda<=4;wanda++);
    {
    cout<<"DATA KE-"<<wanda<<"="<<data[wanda]<<endl;
    }
    }

    X-TKJ-B

    ReplyDelete
  65. #include
    Using namespace std;
    Int main()
    {
    Int data[8]={5,10,15,20,25,30,35,40};
    Int Delvia;
    For(Delvia=0;Delvia<=7;Delvia++)
    {
    Cout<<“DATA KE-“<<“delvia<<“=“<<data[Delvia]<<endl;
    }
    }

    Delvia Khoerun Nisa
    X TKJ B

    ReplyDelete
  66. #include
    using namespace std;
    int main()
    {
    int file[10]={5,4,3,2,1};
    int selvia;
    for(selvia=0;selvia<=9;selvia++);
    {
    cout<<"DATA KE-"selvia<<"="<<data[selvia]<<endl;
    }
    }

    NAMA:SELVIA SARI DEWI
    KELAS:X TKJ B

    ReplyDelete
  67. #include
    using namespace std;

    int main( )
    {
    int matriks [2][4] = {{1,2,3,4},{5,6,7,8}};
    int baris, kolom;
    for (baris=0;baris<2;baris++)
    {
    for (kolom=0;kolom<4;kolom++)
    {
    cout<<matriks[baris][kolom]<<" ";
    }
    cout<<endl;
    }
    }

    X Tkj B

    ReplyDelete