When you press button1 in should take the decimal number from textBox1 and display the binary number in textBox1. Keep getting and error at the point of converting num to Int32.
private void button1_Click(object sender, EventArgs e)
{
int num; // The number input into textBox1
int quot;
num = Convert.ToInt32(textBox1.Text);
string rem;
while(num > 1)
{
quot = num / 2;
rem += (num % 2).ToString();
num = quot;
}
string bin =" ";
for (int i = rem.Length - 1; i >= 0; i--)
{
bin = bin + rem[i];
}
textBox1.Text = bin.ToString();
}