Advertisement
mindoza

Untitled

Nov 2nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. for (int skaic = 1; skaic <= 30; skaic++)
  4. {
  5. bool div3 = skaic % 3 == 0;
  6. bool div5 = skaic % 5 == 0;
  7. bool div15 = skaic % 15 == 0;
  8.  
  9. if (div15)
  10. {
  11. Console.WriteLine("FizzBuzz");
  12. }
  13. else if (div5)
  14. {
  15. Console.WriteLine("Buzz");
  16. }
  17. else if (div3)
  18. {
  19. Console.WriteLine("Fizz");
  20. }
  21. else
  22. {
  23. Console.WriteLine(skaic);
  24. }
  25. }
  26. Console.ReadLine();
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement