fork download
  1. //ANDREW ALSPAUGH CS1A CHAPTER 5. P. 294 # 2
  2. //
  3. /*****************************************************************************
  4.  * Display Characters of ASCII
  5.  * __________________________________________________________________________
  6.  * This program displays each character of the ASCII code with 16 Characters
  7.  * per line of Output
  8.  ****************************************************************************/
  9. #include <iostream>
  10. #include <iomanip>
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. char Character = 0;
  16. while (Character <= 127 && Character >= 0)
  17. {
  18. cout << Character++ << setw(2);
  19. //Line Break at Multiples of 16
  20. if (Character == 16)
  21. cout << endl;
  22. if (Character == 32)
  23. cout << endl;
  24. if (Character == 48)
  25. cout << endl;
  26. if (Character == 64)
  27. cout << endl;
  28. if (Character == 80)
  29. cout << endl;
  30. if (Character == 96)
  31. cout << endl;
  32. if (Character == 112)
  33. cout << endl;
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
         	 
   
  
                
   ! " # $ % & ' ( ) * + , - . /
 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
 @ A B C D E F G H I J K L M N O
 P Q R S T U V W X Y Z [ \ ] ^ _
 ` a b c d e f g h i j k l m n o
 p q r s t u v w x y z { | } ~