LoginSignup
0
0

More than 3 years have passed since last update.

3の倍数、5の倍数のとき

Last updated at Posted at 2020-05-18

学習過程の覚書です。

 <script>
    var i=1; 
    while (i <= 100) {
     if (i%3 == 0 && i%5 == 0) {
       document.write("<p>A</p>")
     } else if ( i%3 == 0) {
         document.write("<p>B</p>")
     } else if (i%5 == 0) {
         document.write("<p>AB</p>")
     } else {
         document.write("<p>"+i+"<br></p>") //その他の数字
     }
     i++;
    }
</script>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0