Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FizzBuzz C#
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; namespace Rextester { public class Program { public static void Main(string[] args) { string s1 = "Fizz"; string s2 = "Buzz"; for (int i = 1; i <= 100; ++i) { // Multiple of 3 if ((i % 3) == 0) { Console.Write(s1); // Also multiple of 5 if ((i % 5) == 0) { Console.Write(s2); } } // Multiple of 5 else if ((i % 5) == 0) { Console.Write(s2); } else { Console.Write(i); } Console.Write("\n"); } } } }
run
|
edit
|
history
|
help
0
Extension Methods (edited)
SCZDXA S
Problem_fb_series
Delegates
C#: Strings / Char Test
FindElementInAscendingSortedRotatedArray
SMS recipient filter testing
Interface
PermuteAString
pyramidnos