View the step-by-step solution to:

# If the number is divisiable by 3 print out "fizz" 2.

Design a program to print out numbers from 1 to 20 (please show Java code of program)

Rules

1. If the number is divisiable by 3 print out "fizz"

2. If the number is divisible by 5 print out "buzz"

3. IF the number is divisible by both 3 & 5 print out "fizzbuzz"

4. Else just print out the number

Sign up to view the entire interaction

Dear Student , PFA the solution . I have... View the full answer

public class DivisibilityTest { public void divisible(int i) { //if no. is divisible by 3 &amp; 5 both if (i % 3 == 0 &amp;&amp; i % 5 == 0) { System.out.println(&quot;fizzbuzz&quot;); } //if no....

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents