0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ruby 初歩的な比較演算時まとめ

Last updated at Posted at 2019-11-28

目的

  • Rubyのif文などで使用する比較演算子をメモ程度にまとめる

比較演算子記載方法まとめ

比較演算子 意味
A < B AがBより小さい
A <= B AがB以下
A > B BがAより小さい
A >= B BがA以下
A == B AがBと等しい
A != B AがBと異なる

書き方の例

  • 下記に比較演算子を用いた簡単な条件分岐処理を記載する。

    # 変数格納
    age = 23
    
    if age >= 20
      puts "成人しています"
    end
    
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?