ASCII Table

how would I make a table that outputs ASCII values using nested loops?
I know I would need two variables, say x and y, where they add up to the numerical value of ASCII character.

cout << (x+y);

If this is what my table should look like, how do I get there?

0 1 2 3 4 5 6 7 8 9

40 ( ) * + , - . / 0 1
50 2 .. .. ..
60
70
80
90
100
110
if you feel compelled to use integers or something:
cout << (char)(x+y)

or just use chars..

char x,y; //you can treat these as integers.

for(x = something; x < somethingelse; x+= incrementer)
for(y = ysmth; y < yelse; y+= yinc)
cout << x+y; //should still be a char here.


Not sure what loop you need, I couldn't make any sense of what you gave.

you CAN loop over letters :)
for(y = '1'; y <= '9'; y++) //eg 1 to 9

Topic archived. No new replies allowed.