Program Array Dengan Constanta

Posted: 16 Maret 2013 in Pemrograman C++

/* Menyatakan ukuran array dengan const */

#include <iostream.h>
#include <conio.h>
main ()
{
const int arraySize = 10;

int n[arraySize];
cout<<“Elemen       Nilai\n”;
for (int i=0; i<arraySize; i++)
{
n[i] = 2 + 2 * i;
cout<<”   “<<i<<”           “<<n[i]<<endl;
}

getch();
}

Tampilan :
Ukuran Array Dgn Constanta

Komentar
  1. […] Program Array Dengan Constanta […]

  2. […] Program Array Dengan Constanta […]

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s