I've just started with programming using c# for creating windows form app in VB.The exercise is the following : "Write a program that prints the numbers 1 to 100. But for multiples of three print "Fizz" instead of the number and for multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"." How can this be done using for loop or while/do-while loop?
int sum = 0;
string text = " ";
for (int counter = 0; counter <=100; counter++)
{
sum += counter;
text = text + " " + counter.ToString;
}
lsbAdd.Items.Add(text);
}
}
}