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.

100日後くらいに個人開発するぞ!day037

Posted at

今日はRubyを動かしてみた!

image.png

今日の学び

Rubyとは

  • RubyはWEBアプリケーションシステムをつくるためのプログラミング言語
  • PHPやPythonと類似

Rubyで文字を出力する方法

  • puts "テキスト"というコードを書くと"テキスト"がコンソールに出力される

コメントを書く方法

  • # テキストと書くとその行はコメントになりコンソールには出力されない

四則演算の結果を出力する方法

  • puts 計算式で四則演算の結果を出力できる
    • 例:「4+2」の結果を出力したい場合
      • puts 4+2
  • 「%」を用いると割り算の余りを計算できる
    • 例:「9÷2」の余りを出力したい場合
      • puts 9%2

文字列を連結させたい場合

*puts "テキスト1"+"テキスト2"というように文字列同士を「+」記号を用いると連結することができる

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?