Pertanyaan

11. Which statement will produce the output: 2,4,6,8,10 7 for (inti =1; 1<10; i +=2) System.out.print(i + for (int i =2;1<=10; i +=2) System.out.print(i +"); for (inti =o;is 10; 1 +E 2) System.out.print(i+II III. for (inti =o:is 8; 1+2) System.out.print(i+ 12. Which two are valid syntax to create a for loop (Choose two) (Choose se all correct answers) for(inti =10:1>=0;1++)& System.out.println("l="+1); fortint 0:144 syste

Solusi

Terverifikasi Ahli
4.1 (334 Suara)
Vidyut veteran ยท Tutor selama 9 tahun

Jawaban

11. B 12. A, C

Penjelasan

11. The correct statement that will produce the output `2,4,6,8,10` is the one that correctly initializes the loop, sets the condition for the loop to run, and correctly prints the values. The first option has a syntax error with the variable name "inti" and the condition "1= 0; i--) { System.out.println("i=" + i);}```and```javafor (int i = 0; i