Question 11
class mycontrolstr1 {
public static void main (String as []){
int x = 10 ;
while (x>=0){
System.out.println("Number =" + x); }
}
}
Screen Shot
Question 12
class myfor {
public static void main (String as []){
int x = 10 ;
do {
System.out.println("Inside the loop" + x);
x--;
}while (x>=0);
}
}
Screen Shot
Question 13
class myname {
public static void main (String as []){
for (int x = 0; x<2;x++)> System.out.println("loop"+ x); }
}
}
Screen Shot
Question 14 :SCJP past question
class myname1 {
public static void main (String ar[]){
for (int x=0; x<2;x++){
for(int y = 0; y<3;>
if (x==y){
break ; ]
}
System.out.println("x = "+x +"y ="+y);
}
}
}
}


