char name[]="abcdefghijklmnopqrstuvwxyz0123456789";
char password[6];
srand (time(NULL));
for (int i=0;i<6;i++)
{password[i]=name[rand()%37];
}
cout<<"Your password is:";
for (int y=0;y<6;y++)
{cout<<password[y];}
how to loop it for different length of password?