fork download
  1. // Drew Duffey CSC5 Chapter 5, P.294, #2
  2. //
  3. /*******************************************************************************
  4.  *
  5.  * DISPLAY CHARACTERS
  6.  * _____________________________________________________________________________
  7.  * This program will display the ASCII characters 0-127.
  8.  * _____________________________________________________________________________
  9.  * INPUT
  10.  * This program does not have any user input in order to run, as it simply
  11.  * displays predetermined characters.
  12.  *
  13.  * OUTPUT
  14.  * The output for this program is the ASCII characters 0-127, with 16 characters
  15.  * on each line.
  16.  *
  17. *******************************************************************************/
  18. #include <iostream>
  19. #include <iomanip>
  20. using namespace std;
  21. int main ()
  22. {
  23. int count; //CALC - The count of 16 used for formatting
  24. char currentchar; //CALC - Current ASCII character to be displayed
  25. int totalchars; //CALC - The total characters displayed so far
  26.  
  27. //Initialization
  28. currentchar = 0;
  29. totalchars = 0;
  30.  
  31. while (totalchars < 128)
  32. {
  33. for (count = 1; count <= 16; count++)
  34. {
  35. cout << currentchar;
  36. currentchar++;
  37. totalchars++;
  38. }
  39. cout << "\n";
  40. }
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
	



 !"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~