Guest User

Untitled

a guest
Apr 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using System;
  2.  
  3. class FizzBuzz
  4. {
  5. static void Main ()
  6. {
  7. for (int n = 1; n <= 100; n++) {
  8. if ((n % 3 == 0) && (n % 5 == 0))
  9. Console.WriteLine ("FizzBuzz");
  10. if (n % 3 == 0)
  11. Console.WriteLine ("Fizz");
  12. if (n % 5 == 0)
  13. Console.WriteLine ("Buzz");
  14. else
  15. Console.WriteLine (n.ToString());
  16. }
  17. }
  18. }
Add Comment
Please, Sign In to add comment