when i compile it, i get the 6 random numbers upto 49. after few tries, sometimes I get the same numbers !! so how do i fix this?
Code:
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
int main (void)
{
int a, b, c, d, e, f;
// print title
printf("*** 6/49 LOTTERY PICKER ***\n");
// seed generator with time of day
srand(time(NULL));
a= rand()%49+1;
b= rand()%49+1;
c= rand()%49+1;
d= rand()%49+1;
e= rand()%49+1;
f= rand()%49+1;
printf("My Lucky Numbers Are %d, %d, %d, %d, %d, %d\n", a, b, c, d, e, f);
return 0;