1
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 3 years have passed since last update.

emacs 使い方 (基本)

Posted at

概要

Ruby における if else の使い方

簡単な説明

条件分岐を行いたい場合に、以下のようにして if else を用いる

if  [then]
 ...
[elsif  [then]
 ... ]
...
[else
 ... ]
endputs 'hello world'

if, elsif, および else を用いることで、条件分岐におけるバグを減らすことができる

うるうどしかをスマートに判断するプログラム

year = 1999
if year %4 ==0 then
  return true
else
  return false
end

return year%4 == 0 ? true : false

  • source ~/grad_members_20f/members/FumiyaToyoda/if_else.org
1
0
1

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
1
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?