[root@svr7 bin]# cat lottery.c 

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main() {

    int lottery[7]={},num = 0;

    srand(time(0));

    for (num=0;num<=6;num++){

 lottery[num] =rand() % 36 + 1;

}

    for (num=0;num<=6;num++){

printf("%d ",lottery[num]);

}

    printf("\n");

return 0;

}

[root@svr7 bin]# gcc lottery.c 

[root@svr7 bin]# ./a.out 

27 33 32 23 23 23 13