Quiz (K|C|A)
Write your answer in the corresponding textboxes or choose the rigth radio buttons/checkboxes.
- What will be shown by the following code fragment
var x = 2 ; var y = 2 ; if ( x > y ) { alert("True") ; } else if ( x != y ) { alert("False") ; }
- What will be shown by the following code fragment
var x = "Monday" ; var y = "Monday" ; if ( x == y ) { alert("True") ; } else if ( x == y ) { alert("False") ; }
- What will be shown by the following code fragment
var x = 2 ; if ( x == 2 ) { alert("True") ; }
- What will be shown by the following code fragment
var x = 3 ; if ( x != 2 ) { if ( x > 3) { alert("True") ; } else { alert( "There was an error"); } } else { alert("False"); }
-
Enter the value that will be shown by the following code fragment.
x = 13 ; y = 30 ; if (x > 0){ y = 72; } y = y + 15 ; alert(y) ;
-
Enter the value that will be shown by the following code fragment.
x = -23 ; y = 120 ; if (x > 0)} y = 212 ; } y = y + 52 ; alert(y) ;
-
Enter the value that will be shown by the following code fragment.
x = -3 ; y = 10 ; if ( x > 0 ) { y = 12 ; y = y + 5 ; } alert(y) ;
-
Select the values of
x
for which the following code will produce the value "yes". There may be more than one correct choice.if ( ! (x < 5) ) { alert("yes") ; } else { alert("No") ; }
- what name will this code show?
var name1 = "John" ; var name2 = "Donald" ; var x = 30 ; var person = "unknown"; if ( name1 < name2 ) { person = name1 ; } else { person = name2 ; } alert( person ) ;