Advertisement
Guest User

Untitled

a guest
May 30th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. string Ausgabe;
  4. for (int i = 1; i < 100; i++)
  5. {
  6. if (i % 5 == 0 && i % 3 == 0)
  7. {
  8. Ausgabe = "FizzBuzz";
  9. }
  10. else if (i % 3 == 0)
  11. {
  12. Ausgabe = "Fizz" ;
  13. }
  14. else if (i % 5 == 0)
  15. {
  16. Ausgabe = "Buzz";
  17. }
  18. else
  19. {
  20. Ausgabe = Convert.ToString(i);
  21. }
  22. Console.WriteLine(Ausgabe);
  23. }
  24. Console.ReadLine();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement