One issue with the suggested solutions is that the results will be slightly biased due to rand%(x), where x ranges from 49 to 44. For example, if using a 32 bit random number generator modulo 49, (2^32)%49 = 39, so values 1 to 39 have 87652394 chances of being picked while values 40 to 49 have 87652393 chances of being picked. A random number generator with more bits will reduce the small relative amount of bias. With a 64 bit random number generator, (2^64)%49 = 2, so values 1 to 47 have 376464164769582687 chances of being picked while values 48 to 49 have 376464164769582686 chances of being picked.
The ideal method would use a random number generator with equal probability for all 13983816 (= 2 · 2 · 2 · 3 · 7 · 7 · 11 · 23 · 47) possible cases of 49 things taken 6 at a time. For this particular case, the code could just use random()%13983816, to select a set of 6 numbers.