We can list the entire ASCII character set using the following
program.
/*********************************************
** File: ascii.c
** Author: Sue Bogar
** Date: 3/3/97
** Section: 101
** SSN: 123-45-6789
** EMail: bogar@cs.umbc.edu
**
** print out the ascii characters.
**********************************************/
#include
#include
int main ( )
{
char c ;
printf("An ASCII table:\n\n") ;
for (c = 0 ; c <= 127; c++)
{
if (isprint(c))
{
/* printable characters */
printf("%3d='%c' ", c, c) ;
}
else
{
/* unprintable characters */
printf("%3d= ", c) ;
}
/* print newline every 8 characters */
if (c % 8 == 7)
{
printf("\n") ;
}
}
/* the last newline character */
printf ("\n");
return 0;
}
Note that in the output, not all characters are printable.