Try something like this (if i understood what you wanted correctly that is)

Code:
double randOper(double a, double b)
{
	switch(rand()%4)
	{
		case 0:
			return a+b;

		case 1:
			return a-b;
	
		case 2:
			return a*b;

		case 3:
			return a/b; // Div by zero?
	}
}