I need one function to Generate a random integer from a to b
Ex:
random_num(a,b);
RandomNumBetween(a,b);
int
random_num (int low, int high)
{
random = rand(high-low);
return(low+random);
}
int RandomBetween(int a,int b)
{
int random=rand(max(a,b)-min(a,b));
int start=min(a,b);
return start+random;
}
Users browsing this forum: No registered users and 1 guest