I run this program but it does not assign the value of or 3 to s, instead before running it gave the sintax error unassigned local variable 's'
private void button1_Click(object sender, EventArgs e)
{
int i, y, s;
i = 8;
y = 6;
if (i == 6)
{
s = y;
}
else
{
s = 3;
}
listBox1.Items.Add(s)
}