import javax.swing.JOptionPane; public class MultipleThree { public static void main(String[] main){ int var1 = Integer.parseInt(JOptionPane.showInputDialog("Input end of number : ")); for (int i=1; i <= var1; i++){ if (i%3 ==0){ System.out.println(i); } } } }
- % sign it use for Mod (residual from divide)
- If state use for selection if value variable i mod 3 is 0 then show the number variable i
Ok see you agan in next chapter...