Skip to content

Instantly share code, notes, and snippets.

@thaiall
Created October 1, 2016 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thaiall/ffe05455812d244027811340657fa75b to your computer and use it in GitHub Desktop.
Save thaiall/ffe05455812d244027811340657fa75b to your computer and use it in GitHub Desktop.
โปรแกรมทำงานซ้อนกัน แล้วหาจำนวนรอบที่เกิดขึ้นทั้งหมด ด้วย javascript
<script>
var cnt = 0;
for(var i = 1; i <= 3; i++)
for(var j = 1; j <= i; j++) {
cnt=cnt + 1;
document.write(j + "<br>");
}
document.write("output="+cnt);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment