ASCII columns

I have this code that outputs ASCII code in columuns. But the order of the numbers comes in rows, 32 34 35 36 37 38 39 40 41 42 43 44 45 46 47 etc. But I want it to output the same numbers but vertical, liket this.
32
33
34
35
etc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>   // cout
#include <iomanip>    // setw

using namespace std;
int main ()
{
    int a;                                                                    
    for(a=32;a<=255;++a)                                                      
    {
        cout << a << setw(2) << static_cast<char>(a) << setw(20); 
    }
    return 0;
}
Just modify line 10 to insert an endl character.
What do you mean by that?
1
2
3

 cout << a << setw( 2 ) << static_cast<char>( a ) << setw( 20 ) << endl; 
Topic archived. No new replies allowed.