Using Code in Markdown

Inline Code

To format a piece of code or a function in a paragraph, enclose it in backticks (`), for example:

`printf()` function

The display result is as follows:

Using Code in Markdown0

Code Blocks

Code blocks are created using 4 spaces or a tab character (Tab key).

Example:

    function example() {
console.log('Hello, World!');
}

The display result is as follows:

Using Code in Markdown0

You can also enclose a block of code with triple backticks (```), and optionally specify a language (or leave it unspecified):

```
$(document).ready(function () {
alert('WebCode101');
});
```

The display result is as follows:

Using Code in Markdown0