Preskoči na glavni sadržaj
Prijava
Sign up for FREE
arrow_back
Biblioteka

If-Else Quiz

star
star
star
star
star
Posljednje ažuriranje about 2 years ago
10
1
1
1
1
1
1
1
1
1
1
Pitanje 1
1.

What is output by the code below?

int b = 100;

if( b > 100)

out.print("go");

else if( b > 90)

out.print("it");

else

out.print("up");

out.print("on");

Pitanje 2
2.

What is output by the code below?

int a = 75, b = 100;

if( a > 90)

if( b > 100)

out.print("go");

else if( b > 90)

out.print("it");

else

out.print("up");

out.print("on");

Pitanje 3
3.

What is output by the code below?

int a = 105, b = 120;

if( a > 90)

if( b > 100)

out.print("go");

else if( b > 90)

out.print("it");

else

out.print("up");

out.print("on");

Pitanje 4
4.

What is output by the code below?

int a = 105, b = 40;

if( a > 90)

if( b > 100)

out.print("go");

else if( b > 90)

out.print("it");

else

out.print("up");

out.print("on");

Pitanje 5
5.

What values will be stored in c and d after execution of the following program segment?

int c = 5, d = 10;

if(d>c){

if(c > 50)

c /= 2;

else

c = d-c;

d = d/5;

}

else{

c = c/2;

d = d/2+3;

}

Pitanje 6
6.

What values will be stored in c and d after execution of the following program segment?

int c = 12, d = 3;

if(d>c){

if(c > 50)

c /= 2;

else

c = d-c;

d = d/5;

}

else{

c = c/2;

d = d/2+3;

}

Pitanje 7
7.

What is output by the code below?

int j = 11/2;

switch(j)

{

case 5:j++;break;

case 6:j++;break;

case 7:j++;break;

}

System.out.println(j);

Pitanje 8
8.

What is output by the code below?

int x= 11;

switch( x )

{

case 11 : System.out.print("it");

case 21 : System.out.print("go");

case 98 : System.out.print("up"); break;

}

Pitanje 9
9.

What is output by the code below?

int b = 110;

if( b > 100)

out.print("go");

else if( b > 90)

out.print("it");

else

out.print("up");

out.print("on");

Pitanje 10
10.

What is output by the code below?

int b = -5;

if( b > 100)

out.print("go");

else if( b > 90)

out.print("it");

else

out.print("up");

out.print("on");