Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem: on_off
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main (String args[]) { int chk=0; for(int n=1;n<=100;n++) { chk=0; if(n%3==0 && n%5==0) { System.out.println("OnOff"); chk=1; } if(n%3==0 && chk==0) { System.out.println("On"); chk=1; } if(n%5==0 &&chk==0) { System.out.println("Off"); chk=1; } if(chk==0) System.out.println(""+n); } } }
run
|
edit
|
history
|
help
0
Java Switch
1*2-3+4
HelloUser
karyawan
square of array element
palin
KatyaPetrova
Kochergina
kkk
1a