in Technology by
What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2)); 1. 6 2. 3 3. 2 4. 5

1 Answer

0 votes
by

Answer:-5

Related questions

0 votes
    What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2)); A) 6 B) 3 C) 2 D) 5 #insurance and Loans...
asked Oct 9, 2020 in Technology by JackTerrance
0 votes
    Code A: var x = 10; y = --x + 1; alert(y); Code B: var x = 10; y = x-- + 1; alert(y); What is the output for code A and B? 1. 10,11 2. 10,10 3. 11,10 4. 11,11...
asked Feb 23, 2021 in Technology by JackTerrance
+1 vote
    Code A: var x = 10; y = --x + 1; alert(y); Code B: var x = 10; y = x-- + 1; alert(y); What is the output for code A and B? a)10,11 b)10,10 c)11,10 d)11,11...
asked Oct 8, 2020 in Technology by JackTerrance
0 votes
    In Java, what will be the output of the following code and how? double x=2.9,y=2.5; (SOP is abbreviated form ... x),y)); Explain how Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    (i) x=5, y=6,2=20 Q8) Consider the following statements and describe the output/statement required: ... multiple assignment statements. Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    What is the output for the following code (function f(){ function f(){ return 1; } return f(); function f() { return 2; } })(); 1. NaN 2. 1 3. 2 4. Error...
asked Feb 25, 2021 in Technology by JackTerrance
0 votes
    What is the output for the following code (function f(){ function f(){ return 1; } return f(); function f() { return 2; } })(); a) NaN b) 1 c) 2 d) Error...
asked Oct 9, 2020 in Technology by JackTerrance
0 votes
    What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc ... (id(q) == foo(q)) a) Error b) None c) False d) True...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc ... (id(q) == foo(q)) a) Error b) None c) False d) True...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    Predict the output of the following JavaScript code.
    What is the output you get for the following code? (function() { return typeof arguments; }) (); 1. undefined 2. array 3. arguments 4. object...
asked Feb 25, 2021 in Technology by JackTerrance
...