0

I'm trying to convert binary to decimal numbers. The problem is I don't know the code hehe so can you correct my code?

The code below is for decimal to binary, how to change it into Binary to Decimal?

if (textBox3->Text == "")
    {
        MessageBox::Show("Please Enter a Number", "Binary to Decimal", MessageBoxButtons::OK,
        MessageBoxIcon::Information);
        textBox3->Focus();
    }
    else
    {
        int convertnum = int::Parse(textBox3->Text);
        textBox3->Text = System::Convert::ToString(convertnum,2);
        textBox4->Text = System::Convert::ToString(convertnum);
    }
}
acraig5075
  • 10,588
  • 3
  • 31
  • 50
Newbie07
  • 1
  • 1
  • Is this C# or Java? It's not C++. Edit the question and retag appropriately. – acraig5075 Mar 17 '21 at 08:30
  • hello, thanks for your response, um yes, I pasted it with visual c++ express 2010, then this decimal to binary code also works. hehe – Newbie07 Mar 17 '21 at 08:34
  • Visual Studio Express is an IDE, capable for editing a few languages. You are going to get no answers until you identify the language and retag. Because it is not C++, I can assure you. I'm guessing [tag:c#] – acraig5075 Mar 17 '21 at 08:53
  • Hello, well. if that's your guess, , um can you change it into Binary to Decimal with C#?hehe – Newbie07 Mar 17 '21 at 08:55
  • Does this answer your question? [How to convert binary to decimal](https://stackoverflow.com/questions/1961599/how-to-convert-binary-to-decimal) – acraig5075 Mar 17 '21 at 09:35

0 Answers0