We can list the entire ASCII character set using the following
program.
/* File: ascii.c
print out the ascii characters.
*/
#include
#include
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") ;
}
}
}
Note that in the output, not all characters are printable.