Skip to content

A Ubiquitous Mind

Welcome to my mind, dreams and thoughts

  • Portfolio
    • Dribbbles
    • 2011
  • Design
    • Fonts
    • CSS
    • Posters
    • Inspiration
  • Codes
    • Troubleshooting
    • Tutorials
    • WordPress
  • Cool Stuff
    • tricks
  • Useful links
    • Tools
    • People to Follow
  • About

Tag: fizz buzz

Java examples: Fizz Buzz

11.08.201511.08.2015 Shavin FonsekaLeave a comment

for (int i = 0; i <= l; i++){

    boolean f = i % 3 == 0, b = i % 5 == 0;

    String output = f ? b ? i + " FizzBuzz" : i + " Fizz" : b ? i + " Buzz" : i + "" ;

    System.out.println(output);

}
Posted in Codes, JAVA, LessonsTagged buzz, Code, example, fizz, fizz buzz, JAVA, shorthand, String output, tutorial
Blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • A Ubiquitous Mind
    • Join 41 other followers
    • Already have a WordPress.com account? Log in now.
    • A Ubiquitous Mind
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar