Presentasi 2

· Uncategorized
Penulis

</pre>
using System;

namespace Indek
{
class Program
{
static void Main (string []args)
{
string[] arrIndek = {“1″,”2″,”3″,”4″,”5″,”6”};
string[] arrData = {“10″,”25″,”35″,”40″,”47″,”56”};

string data;
int indek=0;

Console.Write(“Masukkan indek mahasiswa yang dicari = “);
data=Console.ReadLine();

while((indek<arrIndek.Length-1)&&(arrIndek[indek]!=data))
{
indek=indek+1;
}
if(arrIndek[indek]==data)
Console.Write(“\nindek yang ditemukan {0} indek {1}”,data,arrData[indek]);
else
Console.Write(“\ndata {0} tidak ditemukan”,data);
Console.ReadLine();
}
}
}

<pre>

 

 

 

 

 

 

 

 

 

 

 

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

%d blogger menyukai ini: