# 書式付き出力

printによる出力は、さまざまなI/Oストリーム関数で用いられます。以下の違いについて知っておく必要があります。

* `print`: テキストを出力ストリームに出力します（出力後は改行しません）
* `println`: `print`と同じですが、出力後、自動的に改行される点が異なります。
* `eprint`: `print`と同じですが、出力先はエラー用ストリーム（stderr）です。
* `eprintln`: `println`と同じですが、出力先はエラー用ストリーム（stderr）です。
* `panic`: 出力後、プログラムを終了します。

```
print('Hello World')
print('Hello V')
```

上は`Hello WorldHello V`を出力します。

1行目の出力後に次の行を改行したい場合は、`\n`を使います。

```
print('Hello World \n')
print('Hello V ')
```

`\n`を書きたくないのであれば、`println`を使いましょう。

## コメント

Vでは単一行コメント`//`と複数行コメント`/* */`を両方サポートしています。 コメントは、コードの動作を他のユーザーに知らせるドキュメントを書くために用いるべきです。後で有効にしなければならないコードを一時的にコメントアウトするのにも使えます。

```
// This is a single line comment

/* This is a
*  multi-line comment
* /* This could be nested as well*/
*/
```

## 演習

`hello.v`のコードにあるコメントを解除して、何が起きるかを観察しましょう。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://v-community.gitbook.io/v-by-example/jp/examples/section_1/hello_world.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
