Created
August 11, 2012 14:38
-
-
Save azyobuzin/3324957 to your computer and use it in GitHub Desktop.
FizzBuzzVB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Module Module1 | |
Sub Main() | |
Dim count = 100 | |
Dim result = From i In Enumerable.Range(1, count) | |
Select New With { | |
.Number = i, _ | |
.FizzBuzz = IIf(i Mod 15 = 0, "FizzBuzz", | |
IIf(i Mod 3 = 0, "Fizz", | |
IIf(i Mod 5 = 0, "Buzz", "") | |
) | |
) | |
} | |
For Each item In result | |
Console.WriteLine("{0} : {1}", item.Number, item.FizzBuzz) | |
Next | |
Console.ReadKey() | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment