Last active
February 9, 2020 03:41
-
-
Save omega-takai/ba99c764849d931a7dcb0252a0b248df to your computer and use it in GitHub Desktop.
比較演算子を使って奇数偶数を判定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//奇数の場合 | |
if( ( Number % 2 ) !== 0 ) {} | |
//偶数の場合 | |
if( ( Number % 2 ) == 0 ) {} | |
//3の倍数の場合 | |
if( ( Number % 3 ) == 0 ) {} | |
//5の倍数の倍数 | |
if( ( Number % 5 ) == 0 ) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref: https://9-bb.com/?p=11186