Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- for (int skaic = 1; skaic <= 30; skaic++)
- {
- bool div3 = skaic % 3 == 0;
- bool div5 = skaic % 5 == 0;
- bool div15 = skaic % 15 == 0;
- if (div15)
- {
- Console.WriteLine("FizzBuzz");
- }
- else if (div5)
- {
- Console.WriteLine("Buzz");
- }
- else if (div3)
- {
- Console.WriteLine("Fizz");
- }
- else
- {
- Console.WriteLine(skaic);
- }
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement