+ 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); } } }
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.
+ 3
30 is not printed because it is skipped.
if(x == 30){
continue; // skips 30
}
+ 2
But way 30 Is not print in output