c# decimal to binary code
Hex sayıyı binary sayıya çeviren c# vs2022 kodunu drive linkinden indirebilirsiniz:
https://drive.google.com/file/d/18I79p-FMkNJ4RM1P01qySQXu_aBuRpsf/view?usp=sharing
namespace WinFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("Please press the ok key to finish the mathematical operation.");
if (int.TryParse(textBox1.Text, out int decimalNumber))
{
string binaryNumber = "";
while (decimalNumber > 0)
{
binaryNumber = (decimalNumber % 2) + binaryNumber;
decimalNumber /= 2;
textBox2.Text = binaryNumber;
}
}
}
private void Button1_Click(object sender, EventArgs e)
{
if (int.TryParse(textBox1.Text, out int decimalNumber))
{
string binaryNumber = "";
while (decimalNumber > 0)
{
binaryNumber = (decimalNumber % 2) + binaryNumber;
decimalNumber /= 2;
textBox2.Text = binaryNumber;
}
}
}
}
}
Yorumlar
Yorum Gönder