public class Program { public static void main(String[] args) { for(int x=10; x<=40; x=x+10) { if(x == 3 | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

public class Program { public static void main(String[] args) { for(int x=10; x<=40; x=x+10) { if(x == 3

how for with if ... continue works

19th Mar 2017, 7:25 AM
naveen roshan
naveen roshan - avatar
2 Respuestas
+ 12
I'm not sure what you want to do. Continue if x is 30? x will never be 3... for(int x=10; x<=40; x+=10) { if(x == 30) continue; // go to next iteration of the loop }
19th Mar 2017, 8:17 AM
Tashi N
Tashi N - avatar
+ 1
no i just want know how combination of for and if.. continue work..now i got it thanks you...😊
19th Mar 2017, 8:20 AM
naveen roshan
naveen roshan - avatar