Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public class Fizz {
  2.  
  3. public static void main(String[] args) {
  4. // TODO Auto-generated method stub
  5. int count = 0;
  6. for(int i = 0;i<100;i++){
  7. count ++;
  8. if(count % 3 == 0){
  9. if(count % 5 == 0){
  10. System.out.println("fizzbuzz");
  11. }
  12. else{
  13. System.out.println("fizz");
  14. }
  15. }
  16. else if(count % 5 == 0){
  17. System.out.println("buzz");
  18. }
  19. else{
  20. System.out.println(count);
  21. }
  22. }
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement