0
0

java 複雑な条件式 while分

Posted at

while文
条件式の評価結果がtrueならブロックを繰り返し実行する

62a388464d56e891b3ebdf44bc9924d7.png

&&の例
numが10より大きいかつ100より小さいとき
if ( num > 10 && num < 100)

||の例)
numが10より大きいまたは100より小さいとき
if ( num > 10 || num < 100)

☆if文やwhile文で使用する条件は、評価結果がtrueまたはfalseになる式でないとだめ!
 算術演算子や代入式などを条件式に利用することはできない

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