Computer Science, asked by Eshaan1960, 1 year ago

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 meghakatiyar1
1
CO2 is correct according to the snippet so option
b is right
Answered by Anonymous
26
B. Code 2

Hope it helps u
Similar questions