+2 votes
in Class 12 by kratos

Write the code using do while loop without effecting the output:

var prod,b;

prod=1;

for(b=1;b<=10;b+=3)

{

document.write(b);

prod=prod+b*b;

}

document.write("the final product is" & prod);

1 Answer

+4 votes
by kratos
 
Best answer

var prod,b;

prod=1;

b=1;

do

{

document.write(b);

prod=prod+b*b;

b+=3;

}while(b<=10);

document.write("the final prod is" & prod);

...