+ 2

Please explain this program

public class Program { public static void main(String[] args) { for(int x=10; x<=40; x=x+10) { if(x == 30) { continue; } System.out.println(x); } } }

14th Mar 2019, 12:12 AM
Priyanka Gotugade.
Priyanka Gotugade. - avatar
3 Answers
+ 5
You are going through an arithmetic progression with start point 10 and common difference 10. And you want to end at 40. Then, you print all numbers that is not a 30.
14th Mar 2019, 1:06 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
30 is not printed because it is skipped. if(x == 30){ continue; // skips 30 }
14th Mar 2019, 1:46 AM
Diego
Diego - avatar
+ 2
But way 30 Is not print in output
14th Mar 2019, 1:12 AM
Priyanka Gotugade.
Priyanka Gotugade. - avatar