Loading
notes intro/old submit AP Problems the dump links
 

Quiz 10 - loops

 

 

 

id:

1.The condition of a while loop can be used with

int char Strings objects all of them

2. True or false: The statements in a while loop will execute 1 or more times.

 

true false

 

3. What will be printed after the following code?

			  
x=5;
while (x>=0) 
{
     x=x-2;
     System.out.print(x);

}

 

 

4. What is the value of x after the following code:
			  			  
x=5;
while (x<=3)
     x=x/0;
	 

infinite loop, never ends compile time error runtime error x=5 x=0

 

5. What is the value of x after the following code:

x=0;
for (int i=0;i<=3; i++)
     x+=i;

 

6.What will be printed after the following code:

for (int i=0;i<=3; i++)
    for (int x=i; x<3; x++)
		System.out.print(x);