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 1 year has passed since last update.

独習プログラミングの備忘録 4 前編 【制御構文のバリエーション】

Posted at

~学んだこと~
・if分は3種類存在する
if-else文、ifのみの構文、if- if else -else文

・Switch文を用いることでスッキリした条件分岐を書くことができる

・Switch文には使用条件がある
 ・左辺と右辺が一致するかを比較する式であること (「==」のみ)
 ・比較する値が整数であること (小数、文字列は不可)

・enum文を用いることで、複数のint型の定数をまとめることができる

~感じたこと~
誰もが見やすいと感じるプログラムを作成するためには冗長なコードをなくすことだ。
それに基づくと、今回学んだSwitch・enum文は大きな役割を担っていそうである。

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?