fork download
  1. //Jacklyn Isordia CSC5 Chapter 5, P. 294, #02
  2. //
  3. /**************************************************************
  4.  *
  5.  * DISPLAY CHARACTERS FOR THE ASCII CODES
  6.  * ____________________________________________________________
  7.  * This program displays the characters that correspond to the
  8.  * ASCII codes 0 through 127. To keep the output organized,
  9.  * the program displays 16 characters per line.
  10.  * ____________________________________________________________
  11.  * INPUT
  12.  * None (The program uses a counter-controlled loop)
  13.  * OUTPUT
  14.  * The character representation of each ASCII integer value.
  15.  * Formula
  16.  * (i + 1) % 16 == 0 (to trigger a newline every 16 characters)
  17.  *
  18.  **************************************************************/
  19.  
  20. #include <iostream>
  21. using namespace std;
  22.  
  23. int main() {
  24.  
  25.  
  26.  
  27. for (int i = 0; i <= 127; i ++)
  28. {
  29. cout << static_cast<char>(i) << "\t";
  30.  
  31. if ((i + 1) % 16 == 0)
  32. cout << endl;
  33. }
  34. return 0;
  35. }
Success #stdin #stdout 0s 5320KB
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	{	|	}	~