FizzBuzz The question states -
Let's see how to implement the above using C# -
using System; class Demo { static void Main(String[] args) { for(int i=1;i<=100;i++) { if((i%3 == 0) && (i%5==0)) Console.WriteLine("FizzBuzz"); else if(i%3 == 0) Console.WriteLine("Fizz"); else if(i%5 == 0) Console.WriteLine("Buzz"); else Console.WriteLine(i); } } }
The above is the detailed content of Write a C# program to solve the FizzBuzz problem. For more information, please follow other related articles on the PHP Chinese website!