11.08.2010, 15:08
I've searched a lot.. but I find no solutions. Is there any possibility to make a random between 2 numbers? For example between 5 and 10. I hope you can help me.
I've searched a lot.. but I find no solutions. Is there any possibility to make a random between 2 numbers? For example between 5 and 10. I hope you can help me.
|
new
randomvalue[] = { 5, 10 };
printf(" %d", randomvalue[random(sizeof randomvalue)]); //5 or 10
printf(" %d", random(5)+5); // 5 or 6, 7, 8, 9
printf(" %d", random(4)+6); // 6 or 7, 8, 9