Make a lottery system with a specified probability (for example, 10%). (Write a program in C language)

# include & ltstdio.h & gt

# include & ltstdlib.h & gt

void main()

{

int r,p;

char buf

Printf ("Please enter the probability: (for example: probability 10%, enter10) \ n");

scanf("%d ",& ampp);

scanf("%c ",& ampbuf);

while( 1)

{

r = rand()% 10 * 10/p;

If (r==0)

{

Printf ("Congratulations on winning the lottery!" );

}

other

{

Printf ("Don't win!" );

}

printf(" \ n ");

Printf ("Enter to continue! \ n ");

scanf("%c ",& ampbuf);

If (buf! ='\n ')

Break;

}

}