Qt Code:
  1. int math[20][20],aux2,aux3;
  2. for(int i=0;i<40s;i++)
  3. {
  4. do{
  5. aux2=int( rand()%20);
  6. aux3=int( rand()%20);}
  7. while(math[aux2][aux3]==0);
  8. math[aux2][aux3]=1;
  9. }
To copy to clipboard, switch view to plain text mode 

this should make me 40 of math's element to be 1...and it give @ 30-38 numbers....not exactly 40 ....why ???
("rand()" is working good...)