Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Fizz {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- int count = 0;
- for(int i = 0;i<100;i++){
- count ++;
- if(count % 3 == 0){
- if(count % 5 == 0){
- System.out.println("fizzbuzz");
- }
- else{
- System.out.println("fizz");
- }
- }
- else if(count % 5 == 0){
- System.out.println("buzz");
- }
- else{
- System.out.println(count);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement