Minggu, 29 Mei 2011

array dan if else





private void button1_Click(object sender, EventArgs e)
{

int[] arr = { 0, 0, 0, 0, 0, 0, 1, 2, 4, 2, 1 };

string strTampil = "";

listBox1.Items.Add("Distribusi Nilai : ");

for (int x = 0; x < arr.Length; x++) { if (x == 10) strTampil = "1000 : "; else strTampil = Convert.ToString(x * 10) + " - " + Convert.ToString(x * 10 + 9) + " : "; for (int y = 0; y < arr[x]; y++) strTampil += "*"; listBox1.Items.Add(strTampil); strTampil = ""; } } } }

silhkan donwload di link :

http://www.4shared.com/file/kgiWODdr/array_dan_if_else_dan_flowchar.html

Tidak ada komentar:

Posting Komentar