SHARE
TWEET

c# FizzBuzz

jessicakennedy1028 Sep 10th, 2018 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     using System;
  2.     public class Test
  3.     {
  4.         public static void Main()
  5.         {
  6.             for (int i = 1; i <= 100; i++) {
  7.                 Console.WriteLine(i%3==0 && i%5==0 ? "FizzBuzz" : (i%3==0 ? "Fizz" : (i%5==0 ? "Buzz" : i.ToString())));
  8.             }
  9.         }
  10.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top