This page was changed on October 22, 2003 because I found that Internet Explorer now tries to render html tags that appear in text documents (files whose names end in ".txt"). The Opera broswer I normally use renders text files properly, as text! Internet Explorer is trying to be too smart.
It now seems that the only portable way to render a piece of computer code, such as a C program or HTML example, is to embed it within a "pre" tag and replace all "<" characters with "<", ">" characters with ">", and "&" characters with "&". This really stinks because it requires modification of the code being displayed. Thanks, Microsoft!
Here is the C program which used to be in a text file:
#include <stdio.h>
int main (int argc, char *argv[])
{
int i, j;
printf ("<html>\n");
printf ("<head>\n");
printf ("<!-- $Id$ -->\n");
printf ("<title>Hexadecimal Multiplication Table</title>\n");
printf ("</head>\n");
printf ("<body>\n");
printf ("<h1>Hexadecimal Multiplication Table</h1>\n");
printf ("<HR>\n");
printf ("<h3>\n");
printf ("<table border=3 cellpadding = 3>\n");
printf ("<tr>\n");
printf ("<TD ALIGN=CENTER><STRONG>*</STRONG></TD>\n");
for (i = 0; i < 16; i++)
printf ("<TD ALIGN=CENTER><STRONG>%X</STRONG></TD>\n", i);
for (i = 0; i < 16; i++)
{
printf ("<tr>\n");
printf ("<TD ALIGN=CENTER><STRONG>%2X</STRONG></TD>\n", i);
for (j = 0; j < 16; j++) printf ("<TD ALIGN=CENTER>%2X</TD>\n", i * j);
printf ("</tr>\n");
}
printf ("</table>\n");
printf ("<HR>\n");
printf ("I made a hexadecimal multiplication table when I was bored one\n");
printf ("day back in the\n");
printf ("summer of 1985. I decided ten years later, that it would be a\n");
printf ("cute little exercise to\n");
printf ("practice my table building in HTML. I wrote a little\n");
printf ("<A HREF = \"hexmult.c\">C program</A>\n");
printf ("to spit out the HTML for this document. You didn't think I\n");
printf ("actually typed the whole table in, did you?\n");
printf ("<HR>\n");
printf ("<STRONG>1985, 1995 - Evans A Criswell \n");
printf ("\n");
return (0);
}
Back to the Hexadecimal Multiplication Table page.
Back to the math page.
Back to my home page.