Program Array Dengan Constanta & Enumerasi

Posted: 16 Maret 2013 in Pemrograman C++

/* Menyatakan ukuran array dengan constanta dan menggunakan enumerasi */

#include <stdio.h>
#include <iostream.h>
#include <conio.h>
int main()
{
enum WeekDays {Sun,Mon,Tue,Wed,Thu,Fri,Sat,DaysInWeek};
int ArrayWeek[DaysInWeek] = {10,20,30,40,50,60,70};

cout<<“The value at Wednesday is: “;
cout<<ArrayWeek[Wed];

getch();
}

Tampilan :
Ukuran Array Dgn Constanta & Enumerasi

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

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