C++ (Qt) for( int i = 0; i < arr.size(); ++i ) cout << setw( 8 ) << arr[ i ] << ((i % 10)? ", " : "\n");