Computer Code Reference Page

In HTML, we can represent programming code, variables, keyboard input, and system responses using special tags.

[Code Examples] [Keyboard Input] [Variables] [System Messages]


Code Examples

HTML Program:

<pre>
<code>
<html>
<body>
<p>Hello World</p>
</body>
</html>
</code>
</pre>

C Program:

<pre>
<code>
#include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
</code>
</pre>

JavaScript Program:

<pre>
<code>
console.log("Hello World");
</code>
</pre>


Keyboard Input Examples

To Copy text: <kbd>Ctrl</kbd> + <kbd>C</kbd>

To paste text: <kbd>Ctrl</kbd> + <kbd>V</kbd>

To save a file: <kbd>Ctrl</kbd> + <kbd>S</kbd>




Variables in Mathematics

Area of Circle = π × <var>r</var><sup>2</sup>

Speed = <var>d</var> / <var>t</var>




System Messages

Example 1:

Input: 5 + 10

Output: <samp> 15 </samp>


Example 2:

Command: dir

Output: <samp> List of files displayed here </samp>




Bact to top