private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text.Length > 0)
{
string sayii = textBox1.Text.Substring(0, textBox1.Text.Length);
uint[] sayicc = new uint[textBox1.Text.Length];
for (int i = 0; i < textBox1.Text.Length; i++)
{
sayicc = Convert.ToUInt32(sayii - 48);
}
uint[] dizi2 = new uint[textBox1.Text.Length];
uint bit = 1;
for (int j = 0; j < textBox1.Text.Length; j++)
{
dizi2[j] = bit;
bit *= 2;
}
Array.Reverse(dizi2);
uint deger = 0;
for (int i = 0; i <= dizi2.Length - 1; i++)
{
dizi2 *= sayicc;
if (sayicc == 1)
{
deger += dizi2;
}
}
textBox2.Text = " " + deger.ToString();
}
else
{
MessageBox.Show("Deger girilecek alan boş.", "HATA!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
megabuild7 0 Newbie Poster
Mitja Bonca 557 Nearly a Posting Maven
Mitja Bonca 557 Nearly a Posting Maven
megabuild7 0 Newbie Poster
Mohammed Ammar -5 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.