Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace FizzBuzz
- {
- class Program
- {
- /* I realized that I misspelled "buzz" as "bizz."*/
- static void Main(string[] args)
- {
- for (int x = 1; x <= 100; x++)
- {
- if (x % 3 == 0 && x % 5 == 0)
- {
- Console.WriteLine("FizzBuzz");
- }
- else
- {
- if (x%3 == 0)
- {
- Console.WriteLine("Fizz");
- }
- if (x%5 == 0)
- {
- Console.WriteLine("Buzz");
- }
- if (x%3 != 0 && x%5 != 0)
- {
- Console.WriteLine(x);
- }
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement