![Zitat](images/Seamus/misc/quote_icon.png)
Zitat von
ZoX
Vor recht langer Zeit gab es hier mal folgende Aufgabe:
Code:
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
Viel Spaß beim Programmieren
![Biggrin](images/smilies/biggrin.png)
Code:
Module Module1
Sub Main()
For i As Integer = 1 To 100
If i Mod 3 = 0 AndAlso i Mod 5 = 0 Then
Console.WriteLine("FizzBuzz")
ElseIf i Mod 3 = 0 Then
Console.WriteLine("Fizz")
ElseIf i Mod 5 = 0 Then
Console.WriteLine("Buzz")
Else
Console.WriteLine(i.ToString)
End If
Threading.Thread.Sleep(500)
Next
End Sub
End Module