• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

C#'da Girilen Sayıyı Bit Düzeyine Dönüştüren Program

Üyelik Tarihi
7 Ocak 2015
Konular
4,091
Mesajlar
4,274
MFC Puanı
40
Bu program ile textbox'a girdiğimiz bir sayıyı bit bit düzeyine dönüştürebiliriz.

Formumuza 2 textbox ve 1 button ekliyoruz buttonun click olayına aşağıdaki kodu yazıyoruz.

**** = vo id (boşluksuz)

Kod:
private **** button1_Click(object sender, EventArgs e)
{
textBox2.Text = "";
int sayi, t;
sayi = Convert.ToInt32(textBox1.Text);
for (t = 128; t > 0; t = t / 2)
{ if ((sayi & t) != 0) textBox2.Text += "1";
if ((sayi & t) == 0) textBox2.Text += "0";
}
}​
 
Üst