fork download
  1.  
  2. // Adhira B Cs1a CH 5 hw
  3. /***************************************************************
  4.  *
  5.  * DISPLAY CHARACTERS AND ASSIGNED ASCII VALUES
  6.  * ________________________________________________
  7.  * program displays a list of characters aside their ASCII values.
  8.  * _____________________________________________
  9.  * INPUT
  10.  *
  11.  *
  12.  *
  13.  * OUTPUT
  14.  * characters and assigned ascii values
  15.  *
  16.  *
  17.  ***************************************************************/
  18.  
  19. #include <iostream>
  20. #include <iomanip>
  21. #include <string>
  22. #include <cmath>
  23.  
  24. using namespace std;
  25.  
  26. int main() {
  27.  
  28. char asciich = 0;
  29.  
  30. //while loop from 0 until 127
  31. while(asciich < 127){
  32. cout << asciich << " ";
  33.  
  34. // new line after each 16th character
  35. if(asciich % 16 == 0)
  36. cout << endl;
  37. asciich++;
  38. }
  39. return 0;
  40. }
Success #stdin #stdout 0.01s 5288KB
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 { | } ~