console
function sum1() {
var result1 = 0;
for (var i=1; i <= 100; i++) {
result1 += i;
}
return result1
}
document.write(sum1());
document.write("<br/>-------------------<br/>");
function sum2() {
var result2 = 0;
var i = 1;
while (i <= 100) {
result2 += i;
i++;
}
return result2
}
document.write(sum2());
document.write("<br/>-------------------<br/>");
function sum3() {
var result3 = 0;
var i = 1;
do {
result3 += i;
i++;
}
while (i <= 100);
return result3
}
document.write(sum3());
document.write("<br/>-------------------<br/>");
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
</style>
<script>
</script>
</head>
<body>
</body>
</html>