Which is a more efficient code snippet ?
Code 1 :
for(var num=10;num>=1;num--) { document.writeln(num); }
Code 2 :
var num=10; while(num>=1) { document.writeln(num); num++; }
A.Code 1
B.Code 2
C.Both Code 1 and Code 2
D.Cannot Compare
Answers
Answered by
1
CO2 is correct according to the snippet so option
b is right
b is right
Answered by
26
B. Code 2
Hope it helps u
Hope it helps u
Similar questions
English,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago