 <p>The simplest CGI app looks like this:</p> <pre><code>#include &lt;iostream&gt; using namespace std; int main () { cout &lt;&lt; "Content-type:text/html\r\n\r\n"; cout &lt;&lt; "&lt;html&gt;\n"; cout &lt;&lt; "&lt;head&gt;\n"; cout &lt;&lt; "&lt;title&gt;Hello World - First CGI Program&lt;/title&gt;\n"; cout &lt;&lt; "&lt;/head&gt;\n"; cout &lt;&lt; "&lt;body&gt;\n"; cout &lt;&lt; "&lt;h2&gt;Hello World! This is my first CGI program&lt;/h2&gt;\n"; cout &lt;&lt; "&lt;/body&gt;\n"; cout &lt;&lt; "&lt;/html&gt;\n"; return 0; } </code></pre>