单项选择题

下面哪条语句可以生成0-9之间的随机数()

A.magic=rand()%10+1;
B.magic=rand()%10;
C.magic=rand()/10+1;
D.magic=rand()/10;