Print arrays separating its elements

To write a code, which prints the content of an array, separating each of its elements by a comma, avoiding the printing of a comma after the last element, would be easier with this improvement.




/* author: ncomputers.org */
#include<iostream>
using namespace std;

int main(){
    unsigned a[]={0,1,2,3,4,5,6,7,8,9};
    do(unsigned b=0){
        cout<<a[b];
    }while(++b<10){
        cout<<',';
    }
    cout<<endl;
    return 0;
}