Which HTML tag is used to define a piece of computer code?
Analysis & Theory
`<code>` is used to define computer code snippets or programming examples.
What is the purpose of the `<pre>` tag in HTML?
C
To preserve whitespace and line breaks
D
To insert preloaded content
Analysis & Theory
`<pre>` maintains formatting such as spaces and line breaks exactly as written in HTML.
Which tag is used to define keyboard input in HTML?
Analysis & Theory
`<kbd>` is used to represent keyboard input, like keys pressed by the user.
Which HTML tag is used to show the result of a computer program?
Analysis & Theory
`<samp>` is used to define sample output from a program or system.
What does the `<var>` tag represent?
B
A user-defined variable in code
Analysis & Theory
`<var>` represents a variable in programming or mathematical expressions.
What is the output of this code?
```<pre>Hello world</pre>```
Analysis & Theory
`<pre>` preserves spacing exactly as written, so multiple spaces remain visible.
Which element is best for displaying code with preserved formatting and indentation?
Analysis & Theory
Combining `<pre><code>` ensures proper formatting, spacing, and semantic clarity for code blocks.
Which tag is best for inline code (within a paragraph)?
Analysis & Theory
`<code>` is typically used inline, such as inside paragraphs, to show short code snippets.
Which of the following tags is typically used to show output from a program?
Analysis & Theory
`<samp>` is used to display sample output from a program or computer.
Which tag would you use to represent the keyboard key combination Ctrl + S?
Analysis & Theory
`<kbd>` is ideal for showing keyboard input like Ctrl + S.