Advertisement
IanO-B

Untitled

Dec 5th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public class Main {
  2.  
  3. public static void main(String[] args) {
  4. for(double i =1; i <= 100; i++){
  5. if (i % 3 == 0) {
  6. System.out.println("Fizz");
  7. }else if (i % 5 == 0){
  8. System.out.println("Buzz");
  9. } else if (i % 3 == 0 && i % 5 == 0){
  10. System.out.println("FizzBuzz");
  11. }else{
  12. System.out.println(i);
  13. }
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement