Quick Quiz!

Here is a quick quiz to check your understanding of loops.

1

Which of the following is not a nested loop?

A)
for(i=0;i<10;i++){
        for(j=1;j<i+2;j++){
        }
		}
B)
for(i=0;i<10;i++){
       System.out.println("i="+ i);
}
for(j=1;j<i+2;j++){ 
System.out.println("j="+ j );
}
C)
for(i=0;i<10;i++){
        while(j%2!=0)
        { System.out.println(j) ;
        j++; }
}
D)
while(j%2!=0){
				for(i=0;i<10;i++){
       System.out.println(j); 
       j++;
        }
}
Question 1 of 100 attempted

Get hands-on with 1400+ tech skills courses.