array dimensi 2

#include<iostream.h>
#include<conio.h>
void main()
{
long data_penerimaan[2][4];
long tahun,jenjang;

data_penerimaan[0][0]=250;
data_penerimaan[0][1]=300;
data_penerimaan[0][2]=600;
data_penerimaan[0][3]=900;

data_penerimaan[1][0]=90;
data_penerimaan[1][1]=400;
data_penerimaan[1][2]=550;
data_penerimaan[1][3]=850;

cout<<“masukkan tahun penerimaan[2005-2008]:”;
cin>>tahun;
cout<<“masukkan kode jenjang[1=strata I, 2=diploma III]:”;
cin>>jenjang;
cout<<“penerimaan:”<<data_penerimaan[jenjang-1][tahun-2005]<<“orang”;
}

hasilnya ;

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s