fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static void foo(int digit) {
  11. int five;
  12.  
  13. five = digit % 5;
  14.  
  15. if (five == 0)
  16. {
  17. System.out.println("This number is divisible by five!");
  18. }
  19. else {
  20.  
  21. }
  22.  
  23. System.out.println(five);
  24. }
  25. public static void main (String[] args) throws java.lang.Exception
  26. {
  27. for (int digit = 0; digit < 12; ++digit) {
  28. foo(digit);
  29. }
  30. }
  31. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
This number is divisible by five!
0
1
2
3
4
This number is divisible by five!
0
1
2
3
4
This number is divisible by five!
0
1