Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2));
Home
Technology
What is the output for the following function...
asked
Feb 25, 2021
in
Technology
by
JackTerrance
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
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
Feb 25, 2021
by
JackTerrance
Answer:-5
Related questions
0
votes
Q: What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2)); 6 3 2 5
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
interview-question-answer
technology-questions-answers
0
votes
Q: 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?
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
interview-question-answer
technology-questions-answers
+1
vote
Q: 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?
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
interview-question-answer
technology-questions-answers
0
votes
Q: In Java,what will be the output of the following code and how?double x=2.9,y=2.5;(SOP is abbreviated form of System.out.println)SOP(Math.min(Math.floor(x),y));SOP(Math.max(Math.ceil(x),y));
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: (i) x=5, y=6,2=20Q8) Consider the following statements and describe the output/statement required:(a) To retrieve the data type of the inputted string “Covid 19” stored inside the variable Disease.(b) x,y=”99″, “9”,Find the concatenated value of x and y and also retrieve the address of x and y.(c) Q= “Class XI” * 3
(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
computer-science-interview-questions
computer-science-questions
0
votes
Q: What is the output for the following code (function f(){ function f(){ return 1; } return f(); function f() { return 2; } })();
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
interview-question-answer
technology-questions-answers
0
votes
Q: What is the output for the following code (function f(){ function f(){ return 1; } return f(); function f() { return 2; } })();
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
interview-question-answer
technology-questions-answers
0
votes
Q: What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc', 'def'] print(id(q) == foo(q))
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
python-questions-answers
0
votes
Q: What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc', 'def'] print(id(q) == foo(q))
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
python-question-answers
0
votes
Q: Predict the output of the following JavaScript code. <script type="text/javascript" language="javascript"> var x=5; var y=6; var res=eval("x*y"); document.write(res); </script>
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
interview-question-answer
technology-questions-answers
...