17.
What is the sum of roll1 and roll2 after the following code isexecuted?
var roll1=0;
var roll2=0;
while ( roll1+roll2!=6 )
{
roll1=Math.floor(Math.random( )*6+1);
roll2=Math.floor(Math.random( )*6+1);
}
18.
What is the value of newStr after the following code segment isexecuted?
var str =”abc”;
var letter = str.charAt(0);
var rest = str.substring(1, str.length);
var newStr = letter;
letter =rest.charAt(0);
rest = rest.substring(1, str.length);
newStr = rest + letter + newStr;
19.
What is the value of variable num after the following codesegment?
var num = 10;
while ( num > 0 )
{
num = num -1;
}
20.
What is the value of variable num after the following codesegment is executed?
var num = 1;
while ( num >10 )
{
num = num -1;
}
Expert Answer
An answer
PayPal Gateway not configured
PayPal Gateway not configured