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 num=100; int var =0; for(int i=1;i<=num;i++){ var =0; if(i%3==0 && i%5==0){ System.out.println("onoff"); var=1; } if(i%3==0){ System.out.println("on"); var=1; } if(i%5==0){ System.out.println("on"); var=1; } if(var==0){ System.out.println(i); } } } }
run
|
edit
|
history
|
help
0
10 Wizards
assigment java programming
JAVA # Dizi Ortalama
word Ladder
Area of the triangle
decToBin
Random number
Basic LinkedList in Java
multiplo de 4 y 6
VENU DEVELOPMENTS