# Formatted Print

Printing is handled by various I/O stream functions. One should know where to use them accordingly.

* `print`: for printing the text to the output stream without a newline.
* `println`: same as `print` but newline appended automatically.
* `eprint`: same as `print` but the output goes to error stream (stderr).
* `eprintln`: same as `println` but the output goes to error stream (stderr).
* `panic`: outputs and exits from the program.

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

This will print `Hello WorldHello V`

If you want to print the next line on a new line you would have to do `\n`.

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

If you don't want to use `\n` then you can use `println` instead.

## Comments

V supports single line comments `//` and multi-line comments `/* */`. They should be used for documenting the code for letting the other users know how the code works. It can also be used for temporarily commenting the code which has to be used later on.

```
// This is a single line comment

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

## Exercises

Try uncommenting the code in `hello.v` and see what happens.


---

# 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/en/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.
