// ;----------------------------------------------------------- // ; Program Name: Class_Demo // ; File: Demoprob1.cpp // ; Description: Prints the ASCII character set along with its numeric equivalent // ; Author: Jim Adams // ; Environment: MS C++ 6.0 // ; Date Written: 07/13/2001 // ;----------------------------------------------------------- #include void format(int i); void main() { int counter; cout << "ASCII Characters and their numeric equals" << endl; for (counter=32; counter<52; counter++) { format(counter); format(counter+20); format(counter+40); format(counter+60); format(counter+80); cout << endl; } } // Function to print an integer value plus its character equal void format(int i) { cout.width(8); cout << (char) i; cout.width(4); cout << i; }