Originally Posted by Techno
code:
Code:
for (int counter = 1; counter <= 100; counter++)
{
multiple3 = counter % 2;
multiple5 = counter % 3;
if (multiple3 == 0 && multiple5 == 0)
{
//this.listBox1.Items.Add("fizz");
System.Diagnostics.Debug.WriteLine(counter.ToString() + " is divisable by 2 and 3");
}
else if (multiple3 == 0)
{
//this.listBox3.Items.Add("fizzbuzz");
System.Diagnostics.Debug.WriteLine(counter.ToString() + " is divisable by 2");
}
else if (multiple5 == 0)
{
//this.listBox2.Items.Add("buzz");
System.Diagnostics.Debug.WriteLine(counter.ToString() + " is divisable by 3");
}
else
{
//this.listBox4.Items.Add(counter.ToString());
System.Diagnostics.Debug.WriteLine(counter.ToString());
}
}