#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main(void) {
	int Array[10];
    int i = 0;
    srand ( time(NULL) );
    while (i != 6) {
       int candidate = ((rand() % 49) + 1);
       int ok = 1; // ok will become 0 if a duplicate is found
       for (int j = 0 ; ok && j != i ; j++) {
           ok &= (candidate != Array[j]);
       }
       if (ok) {
           Array[i++] = candidate;
           printf("%d ", candidate);
       }
    }
}
