# 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;
}
}