Advertisement
Guest User

BuzzFizz

a guest
Nov 9th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FizzBuzz
  4. {
  5.     class FizzBuzz
  6.     {
  7.         static void Main()
  8.         {
  9.  
  10.             for (int i = 0; i <= 100; i++)
  11.             {
  12.                 if (i % 15 == 0)
  13.                 {
  14.                     Console.WriteLine("FizzBuzz");
  15.                 }
  16.                 else if (i % 3 == 0)
  17.                 {
  18.                     Console.WriteLine("Fizz");
  19.                 }
  20.                 else if (i % 5 == 0)
  21.                 {
  22.                     Console.WriteLine("Buzz");
  23.                 }
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement