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?

計算機実習Ⅰ:Hello, World!

Posted at

新しくプログラミング言語を習得するには、実際に書いてみることが最も効率的。
プログラムの解説は最低限に抑えて、①手を動かしながら、②出力結果を見ながら、習得する方針で作成している。

Hello world

hello.f90
program hello
  implicit none

  print *, 'Hello, World!'
end program hello
  • program hello
    プログラムの開始を宣言している。helloはプログラム名。
  • implicit none
    全ての変数の型を明示的に宣言するようFortranに指示している。
  • print *, 'Hello, World!'
    画面にHello, World!と表示する命令。
  • end program hello
    プログラムの終了を表している。
gfortran hello.f90 -o hello
  • 作成したhello.f90をコンパイル(プログラムを機械語に変換)して、helloに出力する。
./hello
  • コンパイルしたファイルを実行する
Hello, World!
  • Hello, World!と表示される
1
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
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?